Files
dotfiles/.config/nvim/lua/config/key_binds.lua

44 lines
1003 B
Lua
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
-- There are more binds in plugins/
-- /neo-tree.lua
-- /harpoon.lua
vim.cmd([[
" Terminal thingies
tnoremap <C-h> <C-\\><C-o><C-w>h
tnoremap <C-k> <C-\\><C-o><C-w>k
tnoremap <C-l> <C-\\><C-o><C-w>l
tnoremap <C-j> <C-\\><C-o><C-w>j
" Window navigation
nnoremap <C-h> <C-w>h
nnoremap <C-j> <C-w>j
nnoremap <C-k> <C-w>k
nnoremap <C-l> <C-w>l
" Arrows navigation
nnoremap <C-Left> <C-w>h
nnoremap <C-Down> <C-w>j
nnoremap <C-Up> <C-w>k
nnoremap <C-Right> <C-w>l
" I don't remember
nnoremap <C-Space> 
vnoremap <C-Space> 
" Paste shell command output
vnoremap <leader>e :!sh<CR>
" Quick qq macros
nnoremap ' @q
" Clear search
nnoremap @/ <Esc>:noh<CR>
" Copy relative path to clipboard (from infile)
nnoremap <F3> :let @+ = expand("%:f")<CR>
" Copy filename to clipboard (from infile)
nnoremap <F4> :let @+ = expand("%:t")<CR>
" Delete trailing spaces
nnoremap <leader>w :let _s=@/<Bar>:%s/\s\+$//e<Bar>:let @/=_s<Bar>:nohl<CR>
]])