dotfiles/nvim/lua/options.lua

75 lines
2.0 KiB
Lua
Raw Normal View History

2022-01-18 01:25:46 -05:00
local o = vim.opt
local map = vim.api.nvim_set_keymap
vim.g.mapleader = ","
vim.g.maplocalleader = ","
o.modeline = true
o.number = true
o.relativenumber = true
o.clipboard = "unnamedplus"
o.viminfo = ""
-- why viminfo not work
2022-02-15 16:08:17 -05:00
o.expandtab = true
2022-01-18 01:25:46 -05:00
o.tabstop = 4
2022-03-26 13:29:14 -04:00
o.shiftwidth = 0
2022-01-18 01:25:46 -05:00
o.viminfo = ''
2022-02-14 20:30:09 -05:00
vim.g.base16colorspace = 256
2024-11-14 03:41:41 -05:00
vim.g.vimtex_view_method = "zathura"
2022-02-15 14:04:16 -05:00
o.termguicolors = true
2022-02-14 20:30:09 -05:00
2022-12-04 16:32:16 -05:00
vim.cmd [[
augroup spellcheck
au!
au FileType markdown setlocal spell
au FileType plaintex setlocal spell
au FileType tex setlocal spell
au FileType latex setlocal spell
au BufRead,BufNewFile *.md setlocal spell
au BufRead,BufNewFile *.tex setlocal spell
augroup END
]]
o.spelllang = "en_us"
map('i', '<C-L>', '<c-g>u<Esc>[s1z=`]a<c-g>u', { noremap = true })
2024-06-24 17:24:25 -04:00
vim.cmd('colorscheme theme-nvim')
2022-11-08 20:32:39 -05:00
vim.g.airline_theme = 'theme'
2022-01-18 01:25:46 -05:00
2024-06-24 17:24:25 -04:00
local color = require('base16-colorscheme').colors.base02
vim.api.nvim_set_hl(0, 'LineNr', { fg = color, bg = "none" })
2022-01-18 01:25:46 -05:00
map('n', '<Leader>s', ':%s//g<Left><Left>', {})
2022-11-08 20:32:39 -05:00
map('n', '<Leader>e', ':make!<CR>', { noremap = true })
map('n', '<C-o>', ':cclose<CR>', { noremap = true })
map('n', '<C-L>', ':nohlsearch<CR><C-L>', { noremap = true, silent = true })
map('n', ';', ':', { noremap = true })
map('v', ';', ':', { noremap = true })
for i = 1, 9, 1 do
map('', '<Leader>' .. tostring(i), tostring(i) .. 'gt', { noremap = true })
2022-01-18 01:25:46 -05:00
end
2022-11-08 20:32:39 -05:00
map('n', '<C-Left>', ':tabprevious<CR>', { noremap = true })
map('n', '<C-Right>', ':tabnext<CR>', { noremap = true })
map('', '<Leader>0', ':tablast<CR>', { noremap = true })
map('n', 'ZX', '<Cmd>q<CR>', { noremap = true, silent = true })
2022-01-18 01:25:46 -05:00
2022-11-08 20:32:39 -05:00
map('t', '<Esc>', '<C-\\><C-n>', { noremap = true })
2022-01-18 01:25:46 -05:00
2022-11-08 20:32:39 -05:00
o.list = true
2022-01-18 01:25:46 -05:00
o.listchars = {
2022-11-08 20:32:39 -05:00
tab = '',
eol = '¬',
trail = '·',
extends = ''
2022-01-18 01:25:46 -05:00
}
2022-12-04 16:32:16 -05:00
2022-01-18 01:25:46 -05:00
vim.cmd [[
augroup options_guicursor
au!
2022-08-17 16:31:08 -04:00
" Reset to vertical cursor for terminal nvim (https://github.com/neovim/neovim/issues/4867#issuecomment-291249173)
2022-01-18 01:25:46 -05:00
au VimLeave * set guicursor=a:ver90
augroup END
]]