nix-dotfiles/hmModules/apps/neovim/options.lua
Julia Lange 0352e8e4d3 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.
2024-04-18 02:44:29 -07:00

57 lines
1.3 KiB
Lua

-- 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