Neovim, refactor to use modules, lua, and LSP

Refactors the neovim config to use nix modules, and changes the plugins
to favor the builtin neovim LSP over COC. Changes all code to use lua
code instead of vimscript.
This commit is contained in:
Julia Lange 2024-04-16 04:36:26 -07:00
parent ffada2703c
commit 0352e8e4d3
8 changed files with 337 additions and 134 deletions

View file

@ -0,0 +1,57 @@
-- Globals
vim.g.mapleader = ' '
vim.g.maplocalleader = ' '
vim.opt.list = true
vim.bo.filetype = true
vim.opt.updatetime = 300
-- Indentations
vim.opt.tabstop = 2
vim.opt.softtabstop = 0
vim.opt.shiftwidth = 2
vim.opt.smarttab = true
vim.opt.expandtab = true
-- Style
vim.opt.colorcolumn = "80"
vim.opt.showmatch = true
vim.opt.number = true
vim.opt.relativenumber = true
-- Easy Split Navigation
-- nnoremap <C-J> <C-W><C-J>
-- nnoremap <C-K> <C-W><C-K>
-- nnoremap <C-L> <C-W><C-L>
-- nnoremap <C-H> <C-W><C-H>
-- Searching
vim.opt.smartcase = true
-- Backups
vim.opt.swapfile = false
vim.opt.backup = false
vim.opt.undofile = true
vim.opt.undodir = '/home/pan/.config/nvim/undodir'
-- Easy copy and pasting to external programs
-- map <C-y> "+yy
-- map <C-p> "+P
-- autocmd BufRead,BufNewFile *.md call WritingMode()
-- autocmd BufRead,BufNewFile *.tex call WritingMode()
-- autocmd BufRead,BufNewFile *.svx call WritingMode()
-- autocmd BufRead,BufNewFile *.py call PythonMode()
-- function! WritingMode()
-- setlocal textwidth=80
-- setlocal wrap linebreak nolist
-- setlocal whichwrap+=<,>,h,l
-- nnoremap j gj
-- nnoremap k gk
-- setlocal spell spelllang=en_us
-- endfunction
-- function! PythonMode()
-- setlocal foldmethod=indent
-- setlocal foldlevel=99
-- endfunction