1 local map = vim.api.nvim_set_keymap
2 local opts = { noremap=true, silent=true }
6 vim.opt.undofile = true
8 map('', 'Q', '<nop>', opts)
12 vim.g.polyglot_disabled = {'sensible'}
15 local install_path = vim.fn.stdpath('data') .. '/site/pack/paqs/start/paq-nvim'
17 if vim.fn.empty(vim.fn.glob(install_path)) > 0 then
18 vim.fn.system({'git', 'clone', '--depth=1',
19 'https://github.com/savq/paq-nvim.git', install_path})
25 'ctrlpvim/ctrlp.vim'; -- Fuzzy file finding
26 'editorconfig/editorconfig-vim'; -- Follow editorconfig
27 'folke/lsp-colors.nvim'; -- Add LSP colors to any theme
28 'godlygeek/tabular'; -- Line things up
29 'lewis6991/impatient.nvim'; -- Improve startup time
30 'lifepillar/vim-mucomplete'; -- Simple autocompletion
31 'meain/hima-vim'; -- Nice color scheme
32 'nathom/filetype.nvim'; -- Faster filetype.vim replacement
33 'neovim/nvim-lspconfig'; -- LSP configurations
34 'norcalli/nvim-colorizer.lua'; -- Highlight css colors
35 'ntpeters/vim-better-whitespace'; -- Highlight and strip whitespace
36 'savq/paq-nvim'; -- paq manages itself
37 'sheerun/vim-polyglot'; -- Language pack
38 'tpope/vim-commentary'; -- Easily comment
39 'tpope/vim-rsi'; -- Readline bindings
40 'tpope/vim-sensible'; -- Sensible defaults
41 'tpope/vim-speeddating'; -- Modify dates with C-a, C-x
42 'tpope/vim-surround'; -- Easily modify surrounding chars
46 vim.opt.termguicolors = true
47 vim.g.colors_name = 'hima'
49 -- Easier split movement
50 map('n', '<C-h>', '<C-w><C-h>', opts)
51 map('n', '<C-j>', '<C-w><C-j>', opts)
52 map('n', '<C-k>', '<C-w><C-k>', opts)
53 map('n', '<C-l>', '<C-w><C-l>', opts)
55 -- Clear search highlighting
56 map('n', '<C-c>', ':noh<CR>', opts)
59 vim.opt.completeopt = vim.opt.completeopt + 'menuone'
60 vim.opt.completeopt = vim.opt.completeopt - 'preview'
61 vim.opt.shortmess = vim.opt.shortmess + 'c'
64 local lspconfig = require('lspconfig')
66 local on_attach = function(client, bufnr)
68 local function buf_set_keymap(...) vim.api.nvim_buf_set_keymap(bufnr,
70 local function buf_set_option(...) vim.api.nvim_buf_set_option(bufnr,
73 -- Use omnifunc for completion
74 buf_set_option('omnifunc', 'v:lua.vim.lsp.omnifunc')
77 buf_set_keymap('n', 'gD',
78 '<cmd>lua vim.lsp.buf.declaration()<CR>', opts)
79 buf_set_keymap('n', 'gd',
80 '<cmd>lua vim.lsp.buf.definition()<CR>', opts)
81 buf_set_keymap('n', 'gr',
82 '<cmd>lua vim.lsp.buf.references()<CR>', opts)
83 buf_set_keymap('n', 'K',
84 '<cmd>lua vim.lsp.buf.hover()<CR>', opts)
85 buf_set_keymap('n', '<leader>rn',
86 '<cmd>lua vim.lsp.buf.rename()<CR>', opts)
87 buf_set_keymap('n', '[d',
88 '<cmd>lua vim.lsp.diagnostic.goto_prev()<CR>', opts)
89 buf_set_keymap('n', ']d',
90 '<cmd>lua vim.lsp.diagnostic.goto_next()<CR>', opts)
91 buf_set_keymap('n', '<leader>e',
92 '<cmd>lua vim.lsp.diagnostic.show_line_diagnostics()<CR>', opts)
100 for _, server in ipairs(servers) do
101 lspconfig[server].setup {on_attach = on_attach}
104 vim.opt.signcolumn = 'no'
106 -- Jump to files with gf
107 vim.opt.hidden = true
108 vim.opt.path = vim.opt.path + '**'
110 -- Disable intro message
111 vim.opt.shortmess = "I"