From 4347ebf2e2ed78976ac110d212b6e2ad4de0b7a5 Mon Sep 17 00:00:00 2001 From: Armaan Bhojwani Date: Sun, 28 Nov 2021 21:44:55 -0500 Subject: [PATCH] nvim: simplify config --- .config/nvim/init.lua | 73 ++++++++++--------------------------------- 1 file changed, 16 insertions(+), 57 deletions(-) diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index ba9dbf4..1e0bd76 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -1,3 +1,5 @@ +require('impatient') + local map = vim.api.nvim_set_keymap local opts = { noremap=true, silent=true } @@ -10,31 +12,23 @@ 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}) + 'https://github.com/savq/paq-nvim.git', install_path}) end -require('impatient') - 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 - 'junegunn/fzf'; -- Fuzzy file finding - 'junegunn/fzf.vim'; -- Fuzzy file finding '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 - 'norcalli/nvim_utils'; -- Lua conveniences 'ntpeters/vim-better-whitespace'; -- Highlight and strip whitespace - 'nvim-treesitter/nvim-treesitter';-- Parsing - 'romgrk/nvim-treesitter-context'; -- Shows context for where you are 'savq/paq-nvim'; -- paq manages itself 'tpope/vim-commentary'; -- Easily comment 'tpope/vim-rsi'; -- Readline bindings @@ -43,11 +37,9 @@ require('paq') { 'tpope/vim-surround'; -- Easily modify surrounding chars } -require('nvim_utils') - -- Colorscheme vim.opt.termguicolors = true -vim.g.colors_name = 'hima' +vim.g.colors_name = 'hima-plain' -- Easier split movement map('n', '', '', opts) @@ -58,10 +50,6 @@ map('n', '', '', opts) -- Clear search highlighting map('n', '', ':noh', opts) --- FZF -map('n', 'ff', ':Files', opts) --- TODO: Sharp corners... I can't figure this out - -- Disable keyword completion map('i', '', '', opts) map('i', '', '', opts) @@ -105,7 +93,8 @@ end -- Add servers local servers = { - 'clangd' + 'clangd', + 'racket_langserver', } for _, server in ipairs(servers) do @@ -119,45 +108,15 @@ vim.opt.hidden = true vim.opt.path = vim.opt.path + '**' -- Disable intro message -vim.opt.shortmess = "I" - --- Treesitter -require('nvim-treesitter.configs').setup { - ensure_installed = "maintained", - highlight = { - enable = true, - additional_vim_regex_highlighting = false, - }, - incremental_selection = { - enable = true, - keymaps = { - init_selection = "gnn", - node_incremental = "grn", - scope_incremental = "grc", - node_decremental = "grm", - }, - }, - indent = { - enable = true - } -} - --- Folds -vim.opt.foldmethod = 'expr' -vim.opt.foldexpr = 'nvim_treesitter#foldexpr()' -vim.opt.foldenable = false -map('n', 'fe', ':set foldenable', opts) -map('n', 'fd', ':set nofoldenable', opts) - --- Autocommands -local autocommands = { - highlight_yank = { - {'TextYankPost', '*', - 'lua vim.highlight.on_yank{on_visual=false}'}; - }; -} - -nvim_create_augroups(autocommands) +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 -- 2.39.2