summaryrefslogtreecommitdiff
path: root/.config/nvim/init.lua
diff options
context:
space:
mode:
Diffstat (limited to '.config/nvim/init.lua')
-rw-r--r--.config/nvim/init.lua92
1 files changed, 92 insertions, 0 deletions
diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua
new file mode 100644
index 0000000..139e733
--- /dev/null
+++ b/.config/nvim/init.lua
@@ -0,0 +1,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"
+ }
+}
+