Skip to content

Commit 9ee1e9b

Browse files
committed
feat: Add custom plugins for bufferline, lualine, nvim-tree, and tmux navigator
1 parent 8d1ef97 commit 9ee1e9b

6 files changed

Lines changed: 99 additions & 103 deletions

File tree

init.lua

Lines changed: 17 additions & 102 deletions
Original file line numberDiff line numberDiff line change
@@ -1,97 +1,11 @@
1-
--[[
2-
3-
=====================================================================
4-
==================== READ THIS BEFORE CONTINUING ====================
5-
=====================================================================
6-
======== .-----. ========
7-
======== .----------------------. | === | ========
8-
======== |.-""""""""""""""""""-.| |-----| ========
9-
======== || || | === | ========
10-
======== || KICKSTART.NVIM || |-----| ========
11-
======== || || | === | ========
12-
======== || || |-----| ========
13-
======== ||:Tutor || |:::::| ========
14-
======== |'-..................-'| |____o| ========
15-
======== `"")----------------(""` ___________ ========
16-
======== /::::::::::| |::::::::::\ \ no mouse \ ========
17-
======== /:::========| |==hjkl==:::\ \ required \ ========
18-
======== '""""""""""""' '""""""""""""' '""""""""""' ========
19-
======== ========
20-
=====================================================================
21-
=====================================================================
22-
23-
What is Kickstart?
24-
25-
Kickstart.nvim is *not* a distribution.
26-
27-
Kickstart.nvim is a starting point for your own configuration.
28-
The goal is that you can read every line of code, top-to-bottom, understand
29-
what your configuration is doing, and modify it to suit your needs.
30-
31-
Once you've done that, you can start exploring, configuring and tinkering to
32-
make Neovim your own! That might mean leaving Kickstart just the way it is for a while
33-
or immediately breaking it into modular pieces. It's up to you!
34-
35-
If you don't know anything about Lua, I recommend taking some time to read through
36-
a guide. One possible example which will only take 10-15 minutes:
37-
- https://learnxinyminutes.com/docs/lua/
38-
39-
After understanding a bit more about Lua, you can use `:help lua-guide` as a
40-
reference for how Neovim integrates Lua.
41-
- :help lua-guide
42-
- (or HTML version): https://neovim.io/doc/user/lua-guide.html
43-
44-
Kickstart Guide:
45-
46-
TODO: The very first thing you should do is to run the command `:Tutor` in Neovim.
47-
48-
If you don't know what this means, type the following:
49-
- <escape key>
50-
- :
51-
- Tutor
52-
- <enter key>
53-
54-
(If you already know the Neovim basics, you can skip this step.)
55-
56-
Once you've completed that, you can continue working through **AND READING** the rest
57-
of the kickstart init.lua.
58-
59-
Next, run AND READ `:help`.
60-
This will open up a help window with some basic information
61-
about reading, navigating and searching the builtin help documentation.
62-
63-
This should be the first place you go to look when you're stuck or confused
64-
with something. It's one of my favorite Neovim features.
65-
66-
MOST IMPORTANTLY, we provide a keymap "<space>sh" to [s]earch the [h]elp documentation,
67-
which is very useful when you're not exactly sure of what you're looking for.
68-
69-
I have left several `:help X` comments throughout the init.lua
70-
These are hints about where to find more information about the relevant settings,
71-
plugins or Neovim features used in Kickstart.
72-
73-
NOTE: Look for lines like this
74-
75-
Throughout the file. These are for you, the reader, to help you understand what is happening.
76-
Feel free to delete them once you know what you're doing, but they should serve as a guide
77-
for when you are first encountering a few different constructs in your Neovim config.
78-
79-
If you experience any errors while trying to install kickstart, run `:checkhealth` for more info.
80-
81-
I hope you enjoy your Neovim journey,
82-
- TJ
83-
84-
P.S. You can delete this when you're done too. It's your config now! :)
85-
--]]
86-
871
-- Set <space> as the leader key
882
-- See `:help mapleader`
893
-- NOTE: Must happen before plugins are loaded (otherwise wrong leader will be used)
904
vim.g.mapleader = ' '
915
vim.g.maplocalleader = ' '
926

937
-- Set to true if you have a Nerd Font installed and selected in the terminal
94-
vim.g.have_nerd_font = false
8+
vim.g.have_nerd_font = true
959

9610
-- [[ Setting options ]]
9711
-- See `:help vim.opt`
@@ -164,6 +78,8 @@ vim.opt.scrolloff = 10
16478
-- See `:help hlsearch`
16579
vim.keymap.set('n', '<Esc>', '<cmd>nohlsearch<CR>')
16680

81+
-- -- Map <leader>pf to open the default file explorer
82+
-- vim.keymap.set('n', '<leader>pf', ':Explore<CR>', { desc = '[P]roject [F]iles Explorer' })
16783
-- Diagnostic keymaps
16884
vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist, { desc = 'Open diagnostic [Q]uickfix list' })
16985

@@ -230,7 +146,6 @@ vim.opt.rtp:prepend(lazypath)
230146
require('lazy').setup({
231147
-- NOTE: Plugins can be added with a link (or for a github repo: 'owner/repo' link).
232148
'tpope/vim-sleuth', -- Detect tabstop and shiftwidth automatically
233-
234149
-- NOTE: Plugins can also be added by using a table,
235150
-- with the first argument being the link and the following
236151
-- keys can be used to configure plugin behavior/loading/etc.
@@ -398,10 +313,10 @@ require('lazy').setup({
398313
-- Enable Telescope extensions if they are installed
399314
pcall(require('telescope').load_extension, 'fzf')
400315
pcall(require('telescope').load_extension, 'ui-select')
401-
402316
-- See `:help telescope.builtin`
403317
local builtin = require 'telescope.builtin'
404318
vim.keymap.set('n', '<leader>sh', builtin.help_tags, { desc = '[S]earch [H]elp' })
319+
405320
vim.keymap.set('n', '<leader>sk', builtin.keymaps, { desc = '[S]earch [K]eymaps' })
406321
vim.keymap.set('n', '<leader>sf', builtin.find_files, { desc = '[S]earch [F]iles' })
407322
vim.keymap.set('n', '<leader>ss', builtin.builtin, { desc = '[S]earch [S]elect Telescope' })
@@ -615,17 +530,17 @@ require('lazy').setup({
615530
-- - settings (table): Override the default settings passed when initializing the server.
616531
-- For example, to see the options for `lua_ls`, you could go to: https://luals.github.io/wiki/settings/
617532
local servers = {
618-
-- clangd = {},
619-
-- gopls = {},
620-
-- pyright = {},
621-
-- rust_analyzer = {},
533+
clangd = {},
534+
gopls = {},
535+
pyright = {},
536+
rust_analyzer = {},
622537
-- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs
623538
--
624539
-- Some languages (like typescript) have entire language plugins that can be useful:
625540
-- https://github.com/pmizio/typescript-tools.nvim
626541
--
627542
-- But for many setups, the LSP (`ts_ls`) will work just fine
628-
-- ts_ls = {},
543+
ts_ls = {},
629544
--
630545

631546
lua_ls = {
@@ -789,7 +704,7 @@ require('lazy').setup({
789704

790705
-- If you prefer more traditional completion keymaps,
791706
-- you can uncomment the following lines
792-
--['<CR>'] = cmp.mapping.confirm { select = true },
707+
['<CR>'] = cmp.mapping.confirm { select = true },
793708
--['<Tab>'] = cmp.mapping.select_next_item(),
794709
--['<S-Tab>'] = cmp.mapping.select_prev_item(),
795710

@@ -927,18 +842,18 @@ require('lazy').setup({
927842
-- Here are some example plugins that I've included in the Kickstart repository.
928843
-- Uncomment any of the lines below to enable them (you will need to restart nvim).
929844
--
930-
-- require 'kickstart.plugins.debug',
931-
-- require 'kickstart.plugins.indent_line',
932-
-- require 'kickstart.plugins.lint',
933-
-- require 'kickstart.plugins.autopairs',
934-
-- require 'kickstart.plugins.neo-tree',
935-
-- require 'kickstart.plugins.gitsigns', -- adds gitsigns recommend keymaps
845+
require 'kickstart.plugins.debug',
846+
require 'kickstart.plugins.indent_line',
847+
require 'kickstart.plugins.lint',
848+
require 'kickstart.plugins.autopairs',
849+
require 'kickstart.plugins.neo-tree',
850+
require 'kickstart.plugins.gitsigns', -- adds gitsigns recommend keymaps
936851

937852
-- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua`
938853
-- This is the easiest way to modularize your config.
939854
--
940855
-- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going.
941-
-- { import = 'custom.plugins' },
856+
{ import = 'custom.plugins' },
942857
--
943858
-- For additional information with loading, sourcing and examples see `:help lazy.nvim-🔌-plugin-spec`
944859
-- Or use telescope!

lua/custom/plugins/bufferline.lua

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
return {
2+
"akinsho/bufferline.nvim",
3+
dependencies = { "nvim-tree/nvim-web-devicons" },
4+
config = function()
5+
require("bufferline").setup({
6+
options = {
7+
separator_style = "slant", -- Modern separator style
8+
diagnostics = "nvim_lsp", -- Show LSP diagnostics in tabs
9+
show_buffer_icons = true, -- File type icons in tabs
10+
show_buffer_close_icons = false, -- Disable close icons
11+
offsets = {
12+
{ filetype = "NvimTree", text = "File Explorer", highlight = "Directory", text_align = "left" },
13+
},
14+
},
15+
})
16+
vim.keymap.set("n", "<Tab>", ":BufferLineCycleNext<CR>", { desc = "Next buffer" })
17+
vim.keymap.set("n", "<S-Tab>", ":BufferLineCyclePrev<CR>", { desc = "Previous buffer" })
18+
end,
19+
}

lua/custom/plugins/init.lua

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,10 @@
22
-- I promise not to create any merge conflicts in this directory :)
33
--
44
-- See the kickstart.nvim README for more information
5-
return {}
5+
return {
6+
-- other plugins
7+
{
8+
'christoomey/vim-tmux-navigator',
9+
lazy = false, -- Load immediately
10+
},
11+
}

lua/custom/plugins/lualine.lua

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
return {
2+
"nvim-lualine/lualine.nvim",
3+
dependencies = { "nvim-tree/nvim-web-devicons" },
4+
config = function()
5+
require("lualine").setup({
6+
options = {
7+
theme = "tokyonight", -- Use the same theme as your colorscheme
8+
section_separators = { left = "", right = "" },
9+
component_separators = { left = "", right = "" },
10+
},
11+
})
12+
end,
13+
}

lua/custom/plugins/nvim-tree.lua

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
return {
2+
'nvim-tree/nvim-tree.lua',
3+
dependencies = { 'nvim-tree/nvim-web-devicons' },
4+
config = function()
5+
require('nvim-tree').setup {
6+
view = {
7+
width = 30,
8+
side = 'left',
9+
},
10+
renderer = {
11+
highlight_opened_files = 'all',
12+
icons = {
13+
glyphs = {
14+
default = '',
15+
folder = {
16+
arrow_closed = '',
17+
arrow_open = '',
18+
},
19+
},
20+
},
21+
},
22+
}
23+
vim.keymap.set('n', '<leader>pf', ':NvimTreeToggle<CR>', { desc = 'Toggle file explorer' })
24+
vim.keymap.set('n', '<leader>e', ':NvimTreeFocus<CR>', { desc = 'Focus nvim-tree' })
25+
end,
26+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
return {
2+
'christoomey/vim-tmux-navigator',
3+
cmd = {
4+
'TmuxNavigateLeft',
5+
'TmuxNavigateDown',
6+
'TmuxNavigateUp',
7+
'TmuxNavigateRight',
8+
'TmuxNavigatePrevious',
9+
},
10+
keys = {
11+
{ '<c-h>', '<cmd><C-U>TmuxNavigateLeft<cr>' },
12+
{ '<c-j>', '<cmd><C-U>TmuxNavigateDown<cr>' },
13+
{ '<c-k>', '<cmd><C-U>TmuxNavigateUp<cr>' },
14+
{ '<c-l>', '<cmd><C-U>TmuxNavigateRight<cr>' },
15+
{ '<c-\\>', '<cmd><C-U>TmuxNavigatePrevious<cr>' },
16+
},
17+
}

0 commit comments

Comments
 (0)