diff options
Diffstat (limited to 'init.lua')
-rw-r--r-- | init.lua | 43 |
1 files changed, 19 insertions, 24 deletions
@@ -68,6 +68,9 @@ require('lazy').setup({ | |||
68 | -- Detect tabstop and shiftwidth automatically | 68 | -- Detect tabstop and shiftwidth automatically |
69 | 'tpope/vim-sleuth', | 69 | 'tpope/vim-sleuth', |
70 | 70 | ||
71 | -- Use sudo in command mode | ||
72 | 'lambdalisue/suda.vim', | ||
73 | |||
71 | -- NOTE: This is where your plugins related to LSP can be installed. | 74 | -- NOTE: This is where your plugins related to LSP can be installed. |
72 | -- The configuration is done below. Search for lspconfig to find it below. | 75 | -- The configuration is done below. Search for lspconfig to find it below. |
73 | { -- LSP Configuration & Plugins | 76 | { -- LSP Configuration & Plugins |
@@ -92,7 +95,11 @@ require('lazy').setup({ | |||
92 | }, | 95 | }, |
93 | 96 | ||
94 | -- Useful plugin to show you pending keybinds. | 97 | -- Useful plugin to show you pending keybinds. |
95 | { 'folke/which-key.nvim', opts = {} }, | 98 | { 'folke/which-key.nvim', opts = { |
99 | triggers_blacklist = { | ||
100 | n = { ":" }, -- ignore : in normal mode | ||
101 | }, | ||
102 | } }, | ||
96 | { -- Adds git releated signs to the gutter, as well as utilities for managing changes | 103 | { -- Adds git releated signs to the gutter, as well as utilities for managing changes |
97 | 'lewis6991/gitsigns.nvim', | 104 | 'lewis6991/gitsigns.nvim', |
98 | opts = { | 105 | opts = { |
@@ -171,20 +178,14 @@ require('lazy').setup({ | |||
171 | -- | 178 | -- |
172 | -- An additional note is that if you only copied in the `init.lua`, you can just comment this line | 179 | -- An additional note is that if you only copied in the `init.lua`, you can just comment this line |
173 | -- to get rid of the warning telling you that there are not plugins in `lua/custom/plugins/`. | 180 | -- to get rid of the warning telling you that there are not plugins in `lua/custom/plugins/`. |
174 | { import = 'custom.plugins' }, | 181 | --{ import = 'custom.plugins' }, |
175 | }, {}) | 182 | }, {}) |
176 | 183 | ||
177 | -- [[ Setting options ]] | 184 | -- [[ Setting options ]] |
178 | -- See `:help vim.o` | 185 | -- See `:help vim.o` |
179 | 186 | ||
180 | -- Set highlight on search | ||
181 | vim.o.hlsearch = false | ||
182 | |||
183 | -- Make line numbers default | ||
184 | vim.wo.number = true | ||
185 | |||
186 | -- Enable mouse mode | 187 | -- Enable mouse mode |
187 | vim.o.mouse = 'a' | 188 | -- vim.o.mouse = 'a' |
188 | 189 | ||
189 | -- Sync clipboard between OS and Neovim. | 190 | -- Sync clipboard between OS and Neovim. |
190 | -- Remove this option if you want your OS clipboard to remain independent. | 191 | -- Remove this option if you want your OS clipboard to remain independent. |
@@ -194,13 +195,6 @@ vim.o.clipboard = 'unnamedplus' | |||
194 | -- Enable break indent | 195 | -- Enable break indent |
195 | vim.o.breakindent = true | 196 | vim.o.breakindent = true |
196 | 197 | ||
197 | -- Save undo history | ||
198 | vim.o.undofile = true | ||
199 | |||
200 | -- Case insensitive searching UNLESS /C or capital in search | ||
201 | vim.o.ignorecase = true | ||
202 | vim.o.smartcase = true | ||
203 | |||
204 | -- Keep signcolumn on by default | 198 | -- Keep signcolumn on by default |
205 | vim.wo.signcolumn = 'yes' | 199 | vim.wo.signcolumn = 'yes' |
206 | 200 | ||
@@ -215,14 +209,16 @@ vim.o.completeopt = 'menuone,noselect' | |||
215 | -- NOTE: You should make sure your terminal supports this | 209 | -- NOTE: You should make sure your terminal supports this |
216 | vim.o.termguicolors = true | 210 | vim.o.termguicolors = true |
217 | 211 | ||
212 | |||
218 | -- [[ Basic Keymaps ]] | 213 | -- [[ Basic Keymaps ]] |
219 | 214 | ||
220 | -- Keymaps for better default experience | 215 | -- Keymaps for better default experience |
221 | -- See `:help vim.keymap.set()` | 216 | -- See `:help vim.keymap.set()` |
222 | 217 | ||
223 | -- Remap for dealing with word wrap | 218 | -- Use suda.vim to run sudo, or terminal prompt fails |
224 | vim.keymap.set('n', 'k', "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true }) | 219 | -- See more details at https://github.com/neovim/neovim/issues/1716 |
225 | vim.keymap.set('n', 'j', "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true }) | 220 | vim.keymap.set('n', ':W', "SudaWrite %<CR>") |
221 | |||
226 | 222 | ||
227 | -- [[ Highlight on yank ]] | 223 | -- [[ Highlight on yank ]] |
228 | -- See `:help vim.highlight.on_yank()` | 224 | -- See `:help vim.highlight.on_yank()` |
@@ -245,15 +241,14 @@ require('telescope').setup { | |||
245 | ['<C-d>'] = false, | 241 | ['<C-d>'] = false, |
246 | }, | 242 | }, |
247 | }, | 243 | }, |
248 | }, | 244 | },} |
249 | } | ||
250 | 245 | ||
251 | -- Enable telescope fzf native, if installed | 246 | -- Enable telescope fzf native, if installed |
252 | pcall(require('telescope').load_extension, 'fzf') | 247 | pcall(require('telescope').load_extension, 'fzf') |
253 | 248 | ||
254 | -- See `:help telescope.builtin` | 249 | -- See `:help telescope.builtin` |
255 | vim.keymap.set('n', '<leader>?', require('telescope.builtin').oldfiles, { desc = '[?] Find recently opened files' }) | 250 | vim.keymap.set('n', '<leader>f', require('telescope.builtin').oldfiles, { desc = '[f] Find recently opened files' }) |
256 | vim.keymap.set('n', '<leader><space>', require('telescope.builtin').buffers, { desc = '[ ] Find existing buffers' }) | 251 | vim.keymap.set('n', '<leader>q', require('telescope.builtin').buffers, { desc = '[q] Find existing buffers' }) |
257 | vim.keymap.set('n', '<leader>/', function() | 252 | vim.keymap.set('n', '<leader>/', function() |
258 | -- You can pass additional configuration to telescope to change theme, layout, etc. | 253 | -- You can pass additional configuration to telescope to change theme, layout, etc. |
259 | require('telescope.builtin').current_buffer_fuzzy_find(require('telescope.themes').get_dropdown { | 254 | require('telescope.builtin').current_buffer_fuzzy_find(require('telescope.themes').get_dropdown { |
@@ -339,7 +334,7 @@ require('nvim-treesitter.configs').setup { | |||
339 | vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, { desc = "Go to previous diagnostic message" }) | 334 | vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, { desc = "Go to previous diagnostic message" }) |
340 | vim.keymap.set('n', ']d', vim.diagnostic.goto_next, { desc = "Go to next diagnostic message" }) | 335 | vim.keymap.set('n', ']d', vim.diagnostic.goto_next, { desc = "Go to next diagnostic message" }) |
341 | vim.keymap.set('n', '<leader>e', vim.diagnostic.open_float, { desc = "Open floating diagnostic message" }) | 336 | vim.keymap.set('n', '<leader>e', vim.diagnostic.open_float, { desc = "Open floating diagnostic message" }) |
342 | vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist, { desc = "Open diagnostics list" }) | 337 | -- vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist, { desc = "Open diagnostics list" }) |
343 | 338 | ||
344 | -- LSP settings. | 339 | -- LSP settings. |
345 | -- This function gets run when an LSP connects to a particular buffer. | 340 | -- This function gets run when an LSP connects to a particular buffer. |