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})
23 'ap/vim-css-color'; -- Highlight css colors
24 'ctrlpvim/ctrlp.vim'; -- Fuzzy file finding
25 'editorconfig/editorconfig-vim'; -- Follow editorconfig
26 'folke/lsp-colors.nvim'; -- Add LSP colors to any theme
27 'godlygeek/tabular'; -- Line things up
28 'lifepillar/vim-mucomplete'; -- Simple autocompletion
29 'meain/hima-vim'; -- Nice color scheme
30 'neovim/nvim-lspconfig'; -- LSP configurations
31 'ntpeters/vim-better-whitespace'; -- Highlight and strip whitespace
32 'savq/paq-nvim'; -- paq manages itself
33 'sheerun/vim-polyglot'; -- Language pack
34 'tpope/vim-commentary'; -- Easily comment
35 'tpope/vim-rsi'; -- Readline bindings
36 'tpope/vim-sensible'; -- Sensible defaults
37 'tpope/vim-speeddating'; -- Modify dates with C-a, C-x
38 'tpope/vim-surround'; -- Easily modify surrounding chars
42 vim.opt.termguicolors = true
43 vim.g.colors_name = 'hima'
45 -- Easier split movement
46 map('n', '<C-h>', '<C-w><C-h>', opts)
47 map('n', '<C-j>', '<C-w><C-j>', opts)
48 map('n', '<C-k>', '<C-w><C-k>', opts)
49 map('n', '<C-l>', '<C-w><C-l>', opts)
51 -- Clear search highlighting
52 map('n', '<C-c>', ':noh<CR>', opts)
55 vim.opt.completeopt = vim.opt.completeopt + 'menuone'
56 vim.opt.completeopt = vim.opt.completeopt - 'preview'
57 vim.opt.shortmess = vim.opt.shortmess + 'c'
60 local lspconfig = require('lspconfig')
62 local on_attach = function(client, bufnr)
64 local function buf_set_keymap(...) vim.api.nvim_buf_set_keymap(bufnr,
66 local function buf_set_option(...) vim.api.nvim_buf_set_option(bufnr,
69 -- Use omnifunc for completion
70 buf_set_option('omnifunc', 'v:lua.vim.lsp.omnifunc')
73 buf_set_keymap('n', 'gD',
74 '<cmd>lua vim.lsp.buf.declaration()<CR>', opts)
75 buf_set_keymap('n', 'gd',
76 '<cmd>lua vim.lsp.buf.definition()<CR>', opts)
77 buf_set_keymap('n', 'gr',
78 '<cmd>lua vim.lsp.buf.references()<CR>', opts)
79 buf_set_keymap('n', 'K',
80 '<cmd>lua vim.lsp.buf.hover()<CR>', opts)
81 buf_set_keymap('n', '<leader>rn',
82 '<cmd>lua vim.lsp.buf.rename()<CR>', opts)
83 buf_set_keymap('n', '[d',
84 '<cmd>lua vim.lsp.diagnostic.goto_prev()<CR>', opts)
85 buf_set_keymap('n', ']d',
86 '<cmd>lua vim.lsp.diagnostic.goto_next()<CR>', opts)
87 buf_set_keymap('n', '<leader>e',
88 '<cmd>lua vim.lsp.diagnostic.show_line_diagnostics()<CR>', opts)
96 for _, server in ipairs(servers) do
97 lspconfig[server].setup {on_attach = on_attach}
100 vim.opt.signcolumn = 'no'
102 -- Jump to files with gf
103 vim.opt.hidden = true
104 vim.opt.path = vim.opt.path + '**'