"Make search faster
:nnoremap <space> /
"Alternate "nonumber | number | relativenumber"
:nnoremap <C-n> :let [&nu, &rnu] = [!&rnu, &nu+&rnu==1]<cr>
" allows me to use a smarter cgn
nnoremap c* *<c-o>cgn
nnoremap c# #<C-o>cgn
" Tab and Shift tab to go next and previous buffers
nnoremap <Tab> :bnext<CR>:normal <C-g><CR>
nnoremap <S-Tab> :bprevious<CR>:normal <C-g><CR>
" allows to type gf to "go to file"
set path+=.,**
I also like "Ctrl-6" to jump to alternate buffer ":%y+" to copy the entire buffer to the clipboard. "gx" to open links. "gv" to reselect. "gi" to start insert at the last inserting point.
" Use whole "words" when opening URLs.
" This avoids cutting off parameters (after '?') and anchors (after '#').
" See http://vi.stackexchange.com/q/2801/1631
let g:netrw_gx="<cWORD>"
" copy the last command to clipboard
:let @+=@:
" avoid clipboard hacking security issue
" http://thejh.net/misc/website-terminal-copy-paste
inoremap <C-R>+ <C-R><C-R>+
On my ~/.zshrc and ~/.bashrc I have
" lvim opens the last edited file on vim
alias lvim='vim -c "normal '\''0"'
# Edit clipboard on a vim scratch buffer
alias vimscratch="vim -c 'setlocal buftype=nofile bufhidden=wipe nobuflisted noswapfile'"
alias pbpaste='xclip -i -selection clipboard -o'
alias pbcopy='xclip -selection clipboard'
alias vcb="pbpaste | vimscratch -"
# Open files very quicly using fzy
alias nfu='nvim $(find ~/.dotfiles -type f | fzy)'
Currently I have an autoloaded zsh function that goes like this:
# source:https://stackoverflow.com/a/65375231/2571881
function vif() {
local fname
local current_dir=$PWD
cd ~/.dotfiles
fname=$(fzy) || return
vim "$fname"
cd $current_dir
}
# zsh key-binding to run the vif function Ctrl-o
bindkey -s '^o' 'vif^M'
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I have many tricks on at my "init.vim"
I also like "Ctrl-6" to jump to alternate buffer ":%y+" to copy the entire buffer to the clipboard. "gx" to open links. "gv" to reselect. "gi" to start insert at the last inserting point.
On my ~/.zshrc and ~/.bashrc I have
Currently I have an autoloaded zsh function that goes like this: