summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--init.vim55
1 files changed, 48 insertions, 7 deletions
diff --git a/init.vim b/init.vim
index d1d8709..3be0235 100644
--- a/init.vim
+++ b/init.vim
@@ -43,6 +43,7 @@ Plug 'nvim-lua/plenary.nvim'
Plug 'nvim-telescope/telescope.nvim'
Plug 'nvim-treesitter/nvim-treesitter-textobjects'
+Plug 'stevearc/aerial.nvim'
Plug 'tpope/vim-surround'
Plug 'lukas-reineke/indent-blankline.nvim'
@@ -62,6 +63,7 @@ set tabstop=2
set expandtab
set nowrap
set splitright
+set splitbelow
set wildmode=longest,list,full
set scrolloff=8
set number
@@ -69,11 +71,26 @@ set relativenumber
let mapleader=" "
+" Make splitting more congruent with how Tmux does it.
noremap <C-w>% <C-w>v
noremap <C-w>" <C-w>s
+
+" Open a terminal in a split below the current file.
+
+noremap <C-w><C-t> <C-w>s<cmd>term<cr>
+" Opens a terminal in the directory the current file is in.
+noremap <C-w><C-S-t> <C-w>s<cmd>TERM<cr>
+
+" Fix the yank behavior.
noremap Y y$
+
+" Format code. This is <AltGr-u>
noremap ú <cmd>FormatCode<cr>
+
+" Synstack to help profile syntax highlighting issues.
noremap <leader>p <plug>(SynStack)
+
+" Way to find files.
noremap <leader>ff <cmd>Telescope find_files<cr>
inoremap <C-+> <Plug>(vsnip-expand)
@@ -124,7 +141,10 @@ if isdirectory(printf('%s/.config/nvim/after', $HOME))
endif
noremap <leader>nt <cmd>NvimTreeToggle<cr>
-noremap <leader>NE :<C-u>e <C-r>=expand('%:h')<cr>/
+noremap <C-n><C-e> :<C-u>e <C-r>=expand('%:h')<cr>/
+noremap <C-w>. <cmd>lua require('windownav').goto_terminal()<cr>
+noremap <C-w>I <cmd>lua require('windownav').goto_initvim()<cr>
+noremap <C-w>' <cmd>lua require('windownav').goto_lastwin()<cr>
if has('rneovim')
hi ColorColumn guifg=#3a3a3a guibg=none gui=None
@@ -146,6 +166,15 @@ command! W w
let g:indentLine_char = '┆'
lua << EOF
+
+ function remove_package(str)
+ for k, v in pairs(package.loaded) do
+ if string.match(k, "^" .. str) then
+ package.loaded[k] = nil
+ end
+ end
+ end
+
-- CiderLSP
vim.opt.completeopt = { "menu", "menuone", "noselect" }
require("lsp")
@@ -173,11 +202,23 @@ lua << EOF
-- other configuration values here
})
require("indent_blankline").setup {
-
- -- for example, context is off by default, use this to turn it on
- show_current_context = true,
- show_current_context_start = faels,
- char_highlight_list = { "ColorColumn" }
- }
+ -- for example, context is off by default, use this to turn it on
+ show_current_context = true,
+ show_current_context_start = faels,
+ char_highlight_list = { "ColorColumn" }
+ }
+
+ require('aerial').setup({
+ -- optionally use on_attach to set keymaps when aerial has attached to a buffer
+ on_attach = function(bufnr)
+ -- Jump forwards/backwards with '{' and '}'
+ vim.keymap.set('n', '{', '<cmd>AerialPrev<CR>', {buffer = bufnr})
+ vim.keymap.set('n', '}', '<cmd>AerialNext<CR>', {buffer = bufnr})
+ end
+ })
+
+-- You probably also want to set a keymap to toggle aerial
+vim.keymap.set('n', '<leader>a', '<cmd>AerialToggle!<CR>')
EOF
+