]> git.armaanb.net Git - dotfiles.git/blobdiff - .config/nvim/init.lua
nvim: simplify config
[dotfiles.git] / .config / nvim / init.lua
index ffc6359f9f6425371258b2847e9d11c9872f69b2..1e0bd76000d4b56a7e091b23058070554f77d25a 100644 (file)
@@ -1,3 +1,5 @@
+require('impatient')
+
 local map = vim.api.nvim_set_keymap
 local opts = { noremap=true, silent=true }
 
@@ -8,33 +10,26 @@ vim.opt.textwidth = 80
 map('', 'Q', '<nop>', opts)
 vim.g.mapleader = ' '
 
--- Polyglot
-vim.g.polyglot_disabled = {'sensible'}
-
 -- 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})
+       'https://github.com/savq/paq-nvim.git', install_path})
 end
 
-require('impatient')
-
 require('paq') {
-       'ctrlpvim/ctrlp.vim';             -- Fuzzy file finding
+       '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 autocompletion
+       '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
-       'sheerun/vim-polyglot';           -- Language pack
        'tpope/vim-commentary';           -- Easily comment
        'tpope/vim-rsi';                  -- Readline bindings
        'tpope/vim-sensible';             -- Sensible defaults
@@ -44,7 +39,7 @@ require('paq') {
 
 -- Colorscheme
 vim.opt.termguicolors = true
-vim.g.colors_name = 'hima'
+vim.g.colors_name = 'hima-plain'
 
 -- Easier split movement
 map('n', '<C-h>', '<C-w><C-h>', opts)
@@ -55,6 +50,10 @@ map('n', '<C-l>', '<C-w><C-l>', opts)
 -- Clear search highlighting
 map('n', '<C-c>', ':noh<CR>', opts)
 
+-- Disable keyword completion
+map('i', '<C-n>', '<Down>', opts)
+map('i', '<C-p>', '<Up>', opts)
+
 -- Completion
 vim.opt.completeopt = vim.opt.completeopt + 'menuone'
 vim.opt.completeopt = vim.opt.completeopt - 'preview'
@@ -94,7 +93,8 @@ end
 
 -- Add servers
 local servers = {
-       'clangd'
+       'clangd',
+       'racket_langserver',
 }
 
 for _, server in ipairs(servers) do
@@ -108,4 +108,15 @@ vim.opt.hidden = true
 vim.opt.path = vim.opt.path + '**'
 
 -- Disable intro message
-vim.opt.shortmess = "I"
+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