3 local map = vim.api.nvim_set_keymap
4 local opts = { noremap=true, silent=true }
8 vim.opt.undofile = true
10 map('', 'Q', '<nop>', opts)
14 local install_path = vim.fn.stdpath('data') .. '/site/pack/paqs/start/paq-nvim'
15 if vim.fn.empty(vim.fn.glob(install_path)) > 0 then
16 vim.fn.system({'git', 'clone', '--depth=1',
17 'https://github.com/savq/paq-nvim.git', install_path})
21 'dstein64/vim-startuptime'; -- Profile startup time
22 'editorconfig/editorconfig-vim'; -- Follow editorconfig
23 'folke/lsp-colors.nvim'; -- Add LSP colors to any theme
24 'godlygeek/tabular'; -- Line things up
25 'lewis6991/impatient.nvim'; -- Improve startup time
26 'lifepillar/vim-mucomplete'; -- Simple completion
27 'meain/hima-vim'; -- Nice color scheme
28 'nathom/filetype.nvim'; -- Faster filetype.vim replacement
29 'neovim/nvim-lspconfig'; -- LSP configurations
30 'norcalli/nvim-colorizer.lua'; -- Highlight css colors
31 'ntpeters/vim-better-whitespace'; -- Highlight and strip whitespace
32 'savq/paq-nvim'; -- paq manages itself
33 'tpope/vim-commentary'; -- Easily comment
34 'tpope/vim-rsi'; -- Readline bindings
35 'tpope/vim-sensible'; -- Sensible defaults
36 'tpope/vim-speeddating'; -- Modify dates with C-a, C-x
37 'tpope/vim-surround'; -- Easily modify surrounding chars
41 vim.opt.termguicolors = true
42 vim.g.colors_name = 'hima-plain'
44 -- Easier split movement
45 map('n', '<C-h>', '<C-w><C-h>', opts)
46 map('n', '<C-j>', '<C-w><C-j>', opts)
47 map('n', '<C-k>', '<C-w><C-k>', opts)
48 map('n', '<C-l>', '<C-w><C-l>', opts)
50 -- Clear search highlighting
51 map('n', '<C-c>', ':noh<CR>', opts)
53 -- Disable keyword completion
54 map('i', '<C-n>', '<Down>', opts)
55 map('i', '<C-p>', '<Up>', opts)
58 vim.opt.completeopt = vim.opt.completeopt + 'menuone'
59 vim.opt.completeopt = vim.opt.completeopt - 'preview'
60 vim.opt.shortmess = vim.opt.shortmess + 'c'
63 local lspconfig = require('lspconfig')
65 local on_attach = function(client, bufnr)
67 local function buf_set_keymap(...) vim.api.nvim_buf_set_keymap(bufnr,
69 local function buf_set_option(...) vim.api.nvim_buf_set_option(bufnr,
72 -- Use omnifunc for completion
73 buf_set_option('omnifunc', 'v:lua.vim.lsp.omnifunc')
76 buf_set_keymap('n', 'gD',
77 '<cmd>lua vim.lsp.buf.declaration()<CR>', opts)
78 buf_set_keymap('n', 'gd',
79 '<cmd>lua vim.lsp.buf.definition()<CR>', opts)
80 buf_set_keymap('n', 'gr',
81 '<cmd>lua vim.lsp.buf.references()<CR>', opts)
82 buf_set_keymap('n', 'K',
83 '<cmd>lua vim.lsp.buf.hover()<CR>', opts)
84 buf_set_keymap('n', '<leader>rn',
85 '<cmd>lua vim.lsp.buf.rename()<CR>', opts)
86 buf_set_keymap('n', '[d',
87 '<cmd>lua vim.lsp.diagnostic.goto_prev()<CR>', opts)
88 buf_set_keymap('n', ']d',
89 '<cmd>lua vim.lsp.diagnostic.goto_next()<CR>', opts)
90 buf_set_keymap('n', '<leader>e',
91 '<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 = vim.opt.shortmess + 'I'
115 augroup highlight_yank
117 au TextYankPost * silent! lua vim.highlight.on_yank{timeout=200}
121 -- Do not source the default filetype.vim (uses nathom/filetype.nvim instead)
122 vim.g.did_load_filetypes = 1