Skip to content

Instantly share code, notes, and snippets.

@0xZDH
Created May 2, 2020 17:27
Show Gist options
  • Save 0xZDH/6cd52c5b440edd6a4155719eebfb4f6e to your computer and use it in GitHub Desktop.
Save 0xZDH/6cd52c5b440edd6a4155719eebfb4f6e to your computer and use it in GitHub Desktop.
" From: https://github.com/tomnomnom/dotfiles/blob/master/.vimrc
" Highlighting
syntax on
set encoding=utf-8
set pastetoggle=<F2>
" History
set history=50
" Display
set ls=2
set showmode
set showcmd
set modeline
set ruler
set title
set nu
" Line wrapping
set nowrap
set linebreak
"set showbreak=
" Auto indent what you can
set autoindent
" Searching
set ignorecase
set smartcase
set gdefault
set hlsearch
set showmatch
" Enable jumping into files in a search buffer
set hidden
" Make backspace a bit nicer
set backspace=eol,start,indent
" Indentation
set shiftwidth=4
set tabstop=4
set softtabstop=4
set shiftround
set expandtab
" Disable mouse
set mouse=
" Switch tabs
map 8 <Esc>:tabe
map 9 gT
map 0 gt
" Toggle line-wrap
map <F6> <Esc>:set wrap!<CR>
" Open file under cursor in new tab
map <F9> <Esc><C-W>gF<CR>:tabm<CR>
" Base64 decode word under cursor
nmap <Leader>b :!echo <C-R><C-W> \| base64 -d<CR>
" grep recursively for word under cursor
nmap <Leader>g :tabnew\|read !grep -Hnr '<C-R><C-W>'<CR>
" sort the buffer removing duplicates
nmap <Leader>s :%!sort -u --version-sort<CR>
" Write current file with sudo perms
"command! W w !sudo tee % > /dev/null
command! W w
" folding
set nofoldenable
set noesckeys
set nocompatible
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment