]> git.armaanb.net Git - dotfiles.git/blobdiff - .config/nvim/init.lua
nvim: use leader key
[dotfiles.git] / .config / nvim / init.lua
index f06885157ea2cd9ba8aab487afffe96dfa379ac5..d85a06a51f3ff376f7e471c06b1b0d63dbeba88e 100644 (file)
@@ -6,6 +6,7 @@ vim.opt.mouse = 'a'
 vim.opt.undofile = true
 vim.opt.textwidth = 80
 map('', 'Q', '<nop>', opts)
+vim.g.mapleader = ' '
 
 -- Polyglot
 vim.g.polyglot_disabled = {'sensible'}
@@ -19,19 +20,22 @@ if vim.fn.empty(vim.fn.glob(install_path)) > 0 then
 end
 
 require('paq') {
-       'ap/vim-css-color';              -- Highlight css colors
-       'ctrlpvim/ctrlp.vim';            -- Fuzzy file finding
-       'editorconfig/editorconfig-vim'; -- Follow editorconfig
-       'godlygeek/tabular';             -- Line things up
-       'lifepillar/vim-mucomplete';     -- Simple autocompletion
-       'meain/hima-vim';                -- Nice color scheme
-       'neovim/nvim-lspconfig';         -- LSP configurations
-       'sheerun/vim-polyglot';          -- Language pack
-       'tpope/vim-commentary';          -- Easily comment
-       'tpope/vim-rsi';                 -- Readline bindings
-       'tpope/vim-sensible';            -- Sensible defaults
-       'tpope/vim-speeddating';         -- Modify dates with C-a, C-x
-       'tpope/vim-surround';            -- Easily modify sorrounding characters
+       'ap/vim-css-color';               -- Highlight css colors
+       'ctrlpvim/ctrlp.vim';             -- Fuzzy file finding
+       'editorconfig/editorconfig-vim';  -- Follow editorconfig
+       'folke/lsp-colors.nvim';          -- Add LSP colors to any theme
+       'godlygeek/tabular';              -- Line things up
+       'lifepillar/vim-mucomplete';      -- Simple autocompletion
+       'meain/hima-vim';                 -- Nice color scheme
+       'neovim/nvim-lspconfig';          -- LSP configurations
+       'ntpeters/vim-better-whitespace'; -- Highlight and strip whitespace
+       'savq/paq-nvim';                  -- paq manages itself
+       'sheerun/vim-polyglot';           -- Language pack
+       'tpope/vim-commentary';           -- Easily comment
+       'tpope/vim-rsi';                  -- Readline bindings
+       'tpope/vim-sensible';             -- Sensible defaults
+       'tpope/vim-speeddating';          -- Modify dates with C-a, C-x
+       'tpope/vim-surround';             -- Easily modify surrounding chars
 }
 
 -- Colorscheme
@@ -74,12 +78,14 @@ local on_attach = function(client, bufnr)
                '<cmd>lua vim.lsp.buf.references()<CR>', opts)
        buf_set_keymap('n', 'K',
                '<cmd>lua vim.lsp.buf.hover()<CR>', opts)
-       buf_set_keymap('n', '<space>rn',
+       buf_set_keymap('n', '<leader>rn',
                '<cmd>lua vim.lsp.buf.rename()<CR>', opts)
        buf_set_keymap('n', '[d',
                '<cmd>lua vim.lsp.diagnostic.goto_prev()<CR>', opts)
        buf_set_keymap('n', ']d',
                '<cmd>lua vim.lsp.diagnostic.goto_next()<CR>', opts)
+       buf_set_keymap('n', '<leader>e',
+               '<cmd>lua vim.lsp.diagnostic.show_line_diagnostics()<CR>', opts)
 end
 
 -- Add servers
@@ -92,3 +98,7 @@ for _, server in ipairs(servers) do
 end
 
 vim.opt.signcolumn = 'no'
+
+-- Jump to files with gf
+vim.opt.hidden = true
+vim.opt.path = vim.opt.path + '**'