Skip to content

Instantly share code, notes, and snippets.

@jacqinthebox
Last active August 24, 2018 05:44
Show Gist options
  • Save jacqinthebox/488afb38b0a971a7b6e655cdd6d401a6 to your computer and use it in GitHub Desktop.
Save jacqinthebox/488afb38b0a971a7b6e655cdd6d401a6 to your computer and use it in GitHub Desktop.
New vimrc (optimized for note taking)
set laststatus=2
set number
set wrap
set linebreak
set expandtab
set shiftwidth=2
set softtabstop=2
set clipboard=unnamedplus
execute pathogen#infect()
filetype plugin indent on
syntax on
let NERDTreeShowHidden=1
"autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTreeType") && b:NERDTreeType == "primary") | q | endif
"autocmd vimenter * if !argc() | NERDTree | endif
map <F7> mzgg=G`z<CR>
map <F5> :NERDTreeToggle<CR>
set paste
"disable insert key replace toggle:
function s:ForbidReplace()
if v:insertmode isnot# 'i'
call feedkeys("\<Insert>", "n")
endif
endfunction
augroup ForbidReplaceMode
autocmd!
autocmd InsertEnter * call s:ForbidReplace()
autocmd InsertChange * call s:ForbidReplace()
augroup END
"tabs
nnoremap <C-t> :tabnew<Space>
inoremap <C-t> <Esc>:tabnew<Space>
"Tab Navigation
nnoremap <S-h> gT
nnoremap <S-l> gt
"may change from system to system
set t_Co=256
"set clipboard=unnamedplus
set background=dark
colorscheme hybrid_material
let g:airline_theme='base16'
set fillchars=""
set termguicolors
function! SaveWithTimeStamp(filename) range
let l:extension = '.' . fnamemodify( a:filename, ':e' )
if len(l:extension) == 1
let l:extension = '.md'
endif
let l:filename = strftime("%Y%m%d-") . escape( fnamemodify(a:filename, ':r') .l:extension, ' ' )
execute "write " . l:filename
endfunction
command! -nargs=1 Keep call SaveWithTimeStamp( <q-args> )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment