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)
11 vim.g.polyglot_disabled = {'sensible'}
14 local install_path = vim.fn.stdpath('data') .. '/site/pack/paqs/start/paq-nvim'
16 if vim.fn.empty(vim.fn.glob(install_path)) > 0 then
17 vim.fn.system({'git', 'clone', '--depth=1',
18 'https://github.com/savq/paq-nvim.git', install_path})
22 'ap/vim-css-color'; -- Highlight css colors
23 'ctrlpvim/ctrlp.vim'; -- Fuzzy file finding
24 'editorconfig/editorconfig-vim'; -- Follow editorconfig
25 'godlygeek/tabular'; -- Line things up
26 'lifepillar/vim-mucomplete'; -- Simple autocompletion
27 'meain/hima-vim'; -- Nice color scheme
28 'neovim/nvim-lspconfig'; -- LSP configurations
29 'ntpeters/vim-better-whitespace'; -- Highlight and strip whitespace
30 'savq/paq-nvim'; -- paq manages itself
31 'sheerun/vim-polyglot'; -- Language pack
32 'tpope/vim-commentary'; -- Easily comment
33 'tpope/vim-rsi'; -- Readline bindings
34 'tpope/vim-sensible'; -- Sensible defaults
35 'tpope/vim-speeddating'; -- Modify dates with C-a, C-x
36 'tpope/vim-surround'; -- Easily modify surrounding chars
40 vim.opt.termguicolors = true
41 vim.g.colors_name = 'hima'
43 -- Easier split movement
44 map('n', '<C-h>', '<C-w><C-h>', opts)
45 map('n', '<C-j>', '<C-w><C-j>', opts)
46 map('n', '<C-k>', '<C-w><C-k>', opts)
47 map('n', '<C-l>', '<C-w><C-l>', opts)
49 -- Clear search highlighting
50 map('n', '<C-c>', ':noh<CR>', opts)
53 vim.opt.completeopt = vim.opt.completeopt + 'menuone'
54 vim.opt.completeopt = vim.opt.completeopt - 'preview'
55 vim.opt.shortmess = vim.opt.shortmess + 'c'
58 local lspconfig = require('lspconfig')
60 local on_attach = function(client, bufnr)
62 local function buf_set_keymap(...) vim.api.nvim_buf_set_keymap(bufnr,
64 local function buf_set_option(...) vim.api.nvim_buf_set_option(bufnr,
67 -- Use omnifunc for completion
68 buf_set_option('omnifunc', 'v:lua.vim.lsp.omnifunc')
71 buf_set_keymap('n', 'gD',
72 '<cmd>lua vim.lsp.buf.declaration()<CR>', opts)
73 buf_set_keymap('n', 'gd',
74 '<cmd>lua vim.lsp.buf.definition()<CR>', opts)
75 buf_set_keymap('n', 'gr',
76 '<cmd>lua vim.lsp.buf.references()<CR>', opts)
77 buf_set_keymap('n', 'K',
78 '<cmd>lua vim.lsp.buf.hover()<CR>', opts)
79 buf_set_keymap('n', '<space>rn',
80 '<cmd>lua vim.lsp.buf.rename()<CR>', opts)
81 buf_set_keymap('n', '[d',
82 '<cmd>lua vim.lsp.diagnostic.goto_prev()<CR>', opts)
83 buf_set_keymap('n', ']d',
84 '<cmd>lua vim.lsp.diagnostic.goto_next()<CR>', opts)
92 for _, server in ipairs(servers) do
93 lspconfig[server].setup {on_attach = on_attach}
96 vim.opt.signcolumn = 'no'
98 -- Jump to files with gf
100 vim.opt.path = vim.opt.path + '**'