summaryrefslogtreecommitdiff
path: root/.config/nvim/init.lua
blob: e6b4cb0826fb2e3011e936459c003357318b2e89 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
local Plug = vim.fn['plug#']
vim.call('plug#begin')
Plug 'https://github.com/tpope/vim-fugitive'
Plug 'https://github.com/lervag/vimtex'
Plug 'https://github.com/nvim-treesitter/nvim-treesitter'
Plug 'https://github.com/neovim/nvim-lspconfig'
Plug 'https://github.com/ethanholz/nvim-lastplace'
Plug 'https://github.com/mattn/vim-goimports' -- golang.org/x/tools/cmd/goimports
Plug 'https://github.com/junegunn/vim-easy-align'
Plug 'https://github.com/ibhagwan/fzf-lua'
vim.call('plug#end')

vim.opt.shortmess:prepend("IrCFlotTO")
vim.opt.undofile   = true
vim.opt.encoding   = "utf-8"
vim.opt.undodir    = os.getenv("HOME") .. "/.local/share/nvim/undo"
vim.opt.incsearch  = true
vim.opt.hidden     = true -- allow background buffers
vim.opt.laststatus = 2
vim.opt.showmode   = true -- set false when using airline
vim.opt.timeoutlen = 50
vim.opt.mouse      = "a"
vim.opt.mousemodel = "extend"
vim.opt.clipboard  = "unnamedplus"

vim.g.vimtex_view_method = "zathura"

vim.keymap.set("n", "<C-J>", "<C-W><C-J>")
vim.keymap.set("n", "<C-K>", "<C-W><C-K>")
vim.keymap.set("n", "<C-L>", "<C-W><C-L>")
vim.keymap.set("n", "<C-H>", "<C-W><C-H>")
vim.keymap.set("n", "<F3>",  ":set hlsearch!<CR>")

vim.cmd.colorscheme('default')
vim.opt.background                           = "dark"
vim.opt.termguicolors                        = true
vim.opt.guifont                              = "monospace:h14"
vim.g.neovide_theme                          = 'auto'
vim.g.neovide_input_macos_option_key_is_meta = 'both'
vim.g.neovide_cursor_animation_length        = 0.02

vim.cmd.highlight({ "Normal",          "guibg=black"               })
vim.cmd.highlight({ "StatusLine",      "guibg=black", "guifg=gray" })
vim.cmd.highlight({ "Todo",            "guibg=red"                 }) -- TODO
vim.cmd.highlight({ "DiagnosticWarn",  "guibg=#333333"             })
vim.cmd.highlight({ "DiagnosticError", "guibg=#333333"             })

require'nvim-treesitter.configs'.setup {
	ensure_installed = {
	},
	sync_install = true,
	auto_install = true,
	ignore_install = { "latex", "bibtex" },
	highlight = {
		enable = true,
		disable = { "latex", "bibtex" }, -- VimTeX handles this for us
		additional_vim_regex_highlighting = { "latex", "bibtex", "markdown" },
	},
}

require'lspconfig'.clangd.setup{}
require'lspconfig'.pylsp.setup{
	settings = {
		pylsp = {
			plugins = {
				pycodestyle = {
					ignore = {'W391'},
					maxLineLength = 100
				}
			}
		}
	}
}
require'lspconfig'.gopls.setup{}
require'lspconfig'.eslint.setup{}

require'nvim-lastplace'.setup {
	lastplace_ignore_buftype = {"quickfix", "nofile", "help"},
	lastplace_ignore_filetype = {"gitcommit", "gitrebase", "svn", "hgcommit"},
	lastplace_open_folds = true
}