summaryrefslogtreecommitdiff
path: root/.config/nvim/init.lua
blob: 139e733b7127520cf9209d59e495d5e8bee43835 (plain)
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
82
83
84
85
86
87
88
89
90
91
92
vim.cmd([[
	set nu
	set smarttab
	set tabstop=4
	set shiftwidth=4
	set noexpandtab
	set autoindent
	filetype plugin indent on

	colorscheme vim
	set notermguicolors

	set splitbelow splitright

	" Insert mode hjkl
	inoremap <C-h> <Left>
	inoremap <C-j> <Down>
	inoremap <C-k> <Up>
	inoremap <C-l> <Right>

	nnoremap <Space> :

	nnoremap <Leader>o o<Esc>
	nnoremap <Leader>O O<Esc>

	" Some C Macros
	autocmd Filetype c inoremap im<tab> int<Space>main()<Space>{<Enter><Enter>return<Space>0;<Enter>}<Up><Up><Tab>
	autocmd Filetype c inoremap I<tab> #include<Space><><Left>
	autocmd Filetype c inoremap w<tab> while()<Space>{<Enter>}<Esc><Up>e2li
	autocmd Filetype c inoremap f<tab> for(;;)<Space>{<Enter>}<Esc><Up>e2li

	" LaTex Macros
	autocmd Filetype tex inoremap equ<tab> \begin{equation}<Enter><Enter>\end{equation}<Up><Tab>
]])

vim.g.loaded_netrw = 1
vim.g.loaded_netrwPlugin = 1

local function bootstrap_pckr()
	local pckr_path = vim.fn.stdpath("data") .. "/pckr/pckr.nvim"

	if not (vim.uv or vim.loop).fs_stat(pckr_path) then
		vim.fn.system({
			"git",
			"clone",
			"--filter=blob:none",
			"https://github.com/lewis6991/pckr.nvim",
			pckr_path
		})
	end

	vim.opt.rtp:prepend(pckr_path)
end

bootstrap_pckr()

require("pckr").add{
	{
		"christoomey/vim-tmux-navigator",
		cmd = {
			"TmuxNavigateLeft",
			"TmuxNavigateDown",
			"TmuxNavigateUp",
			"TmuxNavigateRight",
			"TmuxNavigatePrevious",
		},
		keys = {
			{ "<c-h>", "<cmd><C-U>TmuxNavigateLeft<cr>" },
			{ "<c-j>", "<cmd><C-U>TmuxNavigateDown<cr>" },
			{ "<c-k>", "<cmd><C-U>TmuxNavigateUp<cr>" },
			{ "<c-l>", "<cmd><C-U>TmuxNavigateRight<cr>" },
			{ "<c-\\>", "<cmd><C-U>TmuxNavigatePrevious<cr>" },
		},
	},
	{
		"windwp/nvim-autopairs",
		event = "InsertEnter",
		config = function()
			require("nvim-autopairs").setup {}
		end
	},
	{
		"nvim-tree/nvim-tree.lua",
		config = function()
			require("nvim-tree").setup()
		end
	},
	{
		"vimwiki/vimwiki"
	}
}