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 local install_path = vim.fn.stdpath('data') .. '/site/pack/paqs/start/paq-nvim'
14 if vim.fn.empty(vim.fn.glob(install_path)) > 0 then
15 vim.fn.system({'git', 'clone', '--depth=1',
16 'https://github.com/savq/paq-nvim.git', install_path})
22 'editorconfig/editorconfig-vim'; -- Follow editorconfig
23 'folke/lsp-colors.nvim'; -- Add LSP colors to any theme
24 'godlygeek/tabular'; -- Line things up
25 'junegunn/fzf'; -- Fuzzy file finding
26 'junegunn/fzf.vim'; -- Fuzzy file finding
27 'lewis6991/impatient.nvim'; -- Improve startup time
28 'lifepillar/vim-mucomplete'; -- Simple autocompletion
29 'meain/hima-vim'; -- Nice color scheme
30 'nathom/filetype.nvim'; -- Faster filetype.vim replacement
31 'neovim/nvim-lspconfig'; -- LSP configurations
32 'norcalli/nvim-colorizer.lua'; -- Highlight css colors
33 'ntpeters/vim-better-whitespace'; -- Highlight and strip whitespace
34 'nvim-treesitter/nvim-treesitter';-- Parsing
35 'romgrk/nvim-treesitter-context'; -- Shows context for where you are
36 'savq/paq-nvim'; -- paq manages itself
37 'tpope/vim-commentary'; -- Easily comment
38 'tpope/vim-rsi'; -- Readline bindings
39 'tpope/vim-sensible'; -- Sensible defaults
40 'tpope/vim-speeddating'; -- Modify dates with C-a, C-x
41 'tpope/vim-surround'; -- Easily modify surrounding chars
45 vim.opt.termguicolors = true
46 vim.g.colors_name = 'hima'
48 -- Easier split movement
49 map('n', '<C-h>', '<C-w><C-h>', opts)
50 map('n', '<C-j>', '<C-w><C-j>', opts)
51 map('n', '<C-k>', '<C-w><C-k>', opts)
52 map('n', '<C-l>', '<C-w><C-l>', opts)
54 -- Clear search highlighting
55 map('n', '<C-c>', ':noh<CR>', opts)
58 map('n', '<leader>ff', ':Files<CR>', opts)
59 -- TODO: Sharp corners... I can't figure this out
61 -- Disable keyword completion
62 map('i', '<C-n>', '<Down>', opts)
63 map('i', '<C-p>', '<Up>', opts)
66 vim.opt.completeopt = vim.opt.completeopt + 'menuone'
67 vim.opt.completeopt = vim.opt.completeopt - 'preview'
68 vim.opt.shortmess = vim.opt.shortmess + 'c'
71 local lspconfig = require('lspconfig')
73 local on_attach = function(client, bufnr)
75 local function buf_set_keymap(...) vim.api.nvim_buf_set_keymap(bufnr,
77 local function buf_set_option(...) vim.api.nvim_buf_set_option(bufnr,
80 -- Use omnifunc for completion
81 buf_set_option('omnifunc', 'v:lua.vim.lsp.omnifunc')
84 buf_set_keymap('n', 'gD',
85 '<cmd>lua vim.lsp.buf.declaration()<CR>', opts)
86 buf_set_keymap('n', 'gd',
87 '<cmd>lua vim.lsp.buf.definition()<CR>', opts)
88 buf_set_keymap('n', 'gr',
89 '<cmd>lua vim.lsp.buf.references()<CR>', opts)
90 buf_set_keymap('n', 'K',
91 '<cmd>lua vim.lsp.buf.hover()<CR>', opts)
92 buf_set_keymap('n', '<leader>rn',
93 '<cmd>lua vim.lsp.buf.rename()<CR>', opts)
94 buf_set_keymap('n', '[d',
95 '<cmd>lua vim.lsp.diagnostic.goto_prev()<CR>', opts)
96 buf_set_keymap('n', ']d',
97 '<cmd>lua vim.lsp.diagnostic.goto_next()<CR>', opts)
98 buf_set_keymap('n', '<leader>e',
99 '<cmd>lua vim.lsp.diagnostic.show_line_diagnostics()<CR>', opts)
107 for _, server in ipairs(servers) do
108 lspconfig[server].setup {on_attach = on_attach}
111 vim.opt.signcolumn = 'no'
113 -- Jump to files with gf
114 vim.opt.hidden = true
115 vim.opt.path = vim.opt.path + '**'
117 -- Disable intro message
118 vim.opt.shortmess = "I"
121 require('nvim-treesitter.configs').setup {
122 ensure_installed = "maintained",
125 additional_vim_regex_highlighting = false,
127 incremental_selection = {
130 init_selection = "gnn",
131 node_incremental = "grn",
132 scope_incremental = "grc",
133 node_decremental = "grm",
142 vim.opt.foldmethod = 'expr'
143 vim.opt.foldexpr = 'nvim_treesitter#foldexpr()'
144 vim.opt.foldenable = false
145 map('n', '<leader>fe', ':set foldenable<CR>', opts)
146 map('n', '<leader>fd', ':set nofoldenable<CR>', opts)