require('impatient') local map = vim.api.nvim_set_keymap local opts = { noremap=true, silent=true } -- General settings vim.opt.mouse = 'a' vim.opt.undofile = true vim.opt.textwidth = 80 map('', 'Q', '', opts) vim.g.mapleader = ' ' -- Plugins local install_path = vim.fn.stdpath('data') .. '/site/pack/paqs/start/paq-nvim' if vim.fn.empty(vim.fn.glob(install_path)) > 0 then vim.fn.system({'git', 'clone', '--depth=1', 'https://github.com/savq/paq-nvim.git', install_path}) end require('paq') { 'dstein64/vim-startuptime'; -- Profile startup time 'editorconfig/editorconfig-vim'; -- Follow editorconfig 'folke/lsp-colors.nvim'; -- Add LSP colors to any theme 'godlygeek/tabular'; -- Line things up 'lewis6991/impatient.nvim'; -- Improve startup time 'lifepillar/vim-mucomplete'; -- Simple completion 'meain/hima-vim'; -- Nice color scheme 'nathom/filetype.nvim'; -- Faster filetype.vim replacement 'neovim/nvim-lspconfig'; -- LSP configurations 'norcalli/nvim-colorizer.lua'; -- Highlight css colors 'ntpeters/vim-better-whitespace'; -- Highlight and strip whitespace 'savq/paq-nvim'; -- paq manages itself 'tpope/vim-commentary'; -- Easily comment 'tpope/vim-rsi'; -- Readline bindings 'tpope/vim-sensible'; -- Sensible defaults 'tpope/vim-speeddating'; -- Modify dates with C-a, C-x 'tpope/vim-surround'; -- Easily modify surrounding chars } -- Colorscheme vim.opt.termguicolors = true vim.g.colors_name = 'hima-plain' -- Easier split movement map('n', '', '', opts) map('n', '', '', opts) map('n', '', '', opts) map('n', '', '', opts) -- Clear search highlighting map('n', '', ':noh', opts) -- Disable keyword completion map('i', '', '', opts) map('i', '', '', opts) -- Completion vim.opt.completeopt = vim.opt.completeopt + 'menuone' vim.opt.completeopt = vim.opt.completeopt - 'preview' vim.opt.shortmess = vim.opt.shortmess + 'c' -- LSP local lspconfig = require('lspconfig') local on_attach = function(client, bufnr) -- Shorthand local function buf_set_keymap(...) vim.api.nvim_buf_set_keymap(bufnr, ...) end local function buf_set_option(...) vim.api.nvim_buf_set_option(bufnr, ...) end -- Use omnifunc for completion buf_set_option('omnifunc', 'v:lua.vim.lsp.omnifunc') -- Keybindings buf_set_keymap('n', 'gD', 'lua vim.lsp.buf.declaration()', opts) buf_set_keymap('n', 'gd', 'lua vim.lsp.buf.definition()', opts) buf_set_keymap('n', 'gr', 'lua vim.lsp.buf.references()', opts) buf_set_keymap('n', 'K', 'lua vim.lsp.buf.hover()', opts) buf_set_keymap('n', 'rn', 'lua vim.lsp.buf.rename()', opts) buf_set_keymap('n', '[d', 'lua vim.lsp.diagnostic.goto_prev()', opts) buf_set_keymap('n', ']d', 'lua vim.lsp.diagnostic.goto_next()', opts) buf_set_keymap('n', 'e', 'lua vim.lsp.diagnostic.show_line_diagnostics()', opts) end -- Add servers local servers = { 'clangd', 'racket_langserver', } for _, server in ipairs(servers) do lspconfig[server].setup {on_attach = on_attach} end vim.opt.signcolumn = 'no' -- Jump to files with gf vim.opt.hidden = true vim.opt.path = vim.opt.path + '**' -- Disable intro message vim.opt.shortmess = vim.opt.shortmess + 'I' -- Highlight on yank vim.cmd([[ augroup highlight_yank autocmd! au TextYankPost * silent! lua vim.highlight.on_yank{timeout=200} augroup END ]]) -- Do not source the default filetype.vim (uses nathom/filetype.nvim instead) vim.g.did_load_filetypes = 1