small changes
This commit is contained in:
parent
4838eae9bc
commit
70e6a0c97c
52
vim/vimrc
52
vim/vimrc
@ -7,13 +7,6 @@
|
|||||||
"general settings
|
"general settings
|
||||||
"------------------------------------------------------------------------------
|
"------------------------------------------------------------------------------
|
||||||
|
|
||||||
"tab/indent
|
|
||||||
set tabstop=4
|
|
||||||
set softtabstop=4
|
|
||||||
set shiftwidth=4
|
|
||||||
set expandtab
|
|
||||||
set autoindent
|
|
||||||
|
|
||||||
"encoding/format
|
"encoding/format
|
||||||
set encoding=utf-8
|
set encoding=utf-8
|
||||||
set fileformats=unix,dos,mac
|
set fileformats=unix,dos,mac
|
||||||
@ -34,6 +27,13 @@ set lazyredraw
|
|||||||
set regexpengine=1
|
set regexpengine=1
|
||||||
set redrawtime=10000
|
set redrawtime=10000
|
||||||
|
|
||||||
|
"tab/indent
|
||||||
|
set tabstop=4
|
||||||
|
set softtabstop=4
|
||||||
|
set shiftwidth=4
|
||||||
|
set expandtab
|
||||||
|
set autoindent
|
||||||
|
|
||||||
"status bar
|
"status bar
|
||||||
set showcmd
|
set showcmd
|
||||||
set wildmenu
|
set wildmenu
|
||||||
@ -69,19 +69,26 @@ set backupdir=~/.vim/.backup//,/tmp//
|
|||||||
set directory=~/.vim/.swap//,/tmp//
|
set directory=~/.vim/.swap//,/tmp//
|
||||||
|
|
||||||
"leader key
|
"leader key
|
||||||
let mapleader=','
|
let mapleader=' '
|
||||||
|
|
||||||
"------------------------------------------------------------------------------
|
"------------------------------------------------------------------------------
|
||||||
"normal mode keybinds
|
"normal/visual mode keybinds
|
||||||
"------------------------------------------------------------------------------
|
"------------------------------------------------------------------------------
|
||||||
|
|
||||||
"normal keybinds
|
"normal keybinds
|
||||||
nnoremap <silent><leader><space> :let @/ = ""<CR>
|
nnoremap <silent><leader><space> :let @/ = ""<CR>
|
||||||
nnoremap <leader>p :set invpaste<CR>
|
nnoremap <leader>p :set invpaste<CR>
|
||||||
|
|
||||||
nnoremap <silent><leader>lb :call ToggleLineBreak()<CR>
|
nnoremap <silent><leader>lb :call ToggleLineBreak()<CR>
|
||||||
nnoremap <silent><leader>wr :call ToggleWrap()<CR>
|
nnoremap <silent><leader>wr :call ToggleWrap()<CR>
|
||||||
nnoremap <silent><leader>cc :call ToggleColorColumn()<CR>
|
nnoremap <silent><leader>cc :call ToggleColorColumn()<CR>
|
||||||
nnoremap <leader>ts "=strftime("%F %T%z")<CR>p
|
|
||||||
|
nnoremap <leader>ts "=strftime("%F %T%z")<CR>
|
||||||
|
nnoremap <leader>dt :r !date<CR>
|
||||||
|
|
||||||
|
nnoremap <leader>rc :vsplit $MYVIMRC<CR>
|
||||||
|
nnoremap <leader>so :source $MYVIMRC<CR>
|
||||||
|
|
||||||
nnoremap =j :%!python -m json.tool<CR>
|
nnoremap =j :%!python -m json.tool<CR>
|
||||||
|
|
||||||
"plugin keybinds
|
"plugin keybinds
|
||||||
@ -92,7 +99,7 @@ if !exists('##TextYankPost')
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
"------------------------------------------------------------------------------
|
"------------------------------------------------------------------------------
|
||||||
"abbreviations
|
"insert mode keybinds and abbreviations
|
||||||
"------------------------------------------------------------------------------
|
"------------------------------------------------------------------------------
|
||||||
|
|
||||||
inoreabbrev <expr> #!! "#!/usr/bin/env"
|
inoreabbrev <expr> #!! "#!/usr/bin/env"
|
||||||
@ -109,6 +116,10 @@ command! Q q
|
|||||||
command! WQ wq
|
command! WQ wq
|
||||||
command! Q1 q!
|
command! Q1 q!
|
||||||
|
|
||||||
|
"function calls
|
||||||
|
command! -nargs=+ SearchGoogle call SearchGoogle(join([<f-args>]))
|
||||||
|
|
||||||
|
|
||||||
"------------------------------------------------------------------------------
|
"------------------------------------------------------------------------------
|
||||||
"plugins (vim-plug)
|
"plugins (vim-plug)
|
||||||
"------------------------------------------------------------------------------
|
"------------------------------------------------------------------------------
|
||||||
@ -261,6 +272,13 @@ endfunction
|
|||||||
"search functions
|
"search functions
|
||||||
"----------------
|
"----------------
|
||||||
|
|
||||||
|
function! SearchGoogle(string)
|
||||||
|
let l:google = "https://www.google.com/search?q="
|
||||||
|
let l:browser = "xdg-open >/dev/null 2>/dev/null"
|
||||||
|
let l:query = substitute(join(split(a:string),"+"),'"',"","g")
|
||||||
|
execute "!" l:browser . "\ " . l:google . l:query
|
||||||
|
endfunction
|
||||||
|
|
||||||
"------------------------------------------------------------------------------
|
"------------------------------------------------------------------------------
|
||||||
"syntax/filetype
|
"syntax/filetype
|
||||||
"------------------------------------------------------------------------------
|
"------------------------------------------------------------------------------
|
||||||
@ -337,7 +355,7 @@ if has("autocmd")
|
|||||||
"go
|
"go
|
||||||
augroup filetype_go
|
augroup filetype_go
|
||||||
autocmd!
|
autocmd!
|
||||||
set expandtab!
|
set expandtab! "go uses real tabs
|
||||||
augroup END
|
augroup END
|
||||||
|
|
||||||
"html
|
"html
|
||||||
@ -346,10 +364,16 @@ if has("autocmd")
|
|||||||
autocmd FileType html :syntax sync fromstart
|
autocmd FileType html :syntax sync fromstart
|
||||||
augroup END
|
augroup END
|
||||||
|
|
||||||
"where tabs should = 2 spaces
|
"markdown
|
||||||
|
augroup filetype_md
|
||||||
|
autocmd!
|
||||||
|
autocmd FileType markdown setlocal sw=4 ts=4 sts=4 expandtab
|
||||||
|
augroup END
|
||||||
|
|
||||||
|
"filestypes where tabs should = 2 spaces
|
||||||
augroup half_tab
|
augroup half_tab
|
||||||
autocmd!
|
autocmd!
|
||||||
autocmd FileType html,javascript,css,json,yaml,yml,sh
|
autocmd FileType html,javascript,css,json,yaml,sh
|
||||||
\ setlocal ts=2 sts=2 sw=2 expandtab
|
\ setlocal ts=2 sts=2 sw=2 expandtab
|
||||||
augroup END
|
augroup END
|
||||||
|
|
||||||
|
|||||||
@ -35,6 +35,18 @@ set esckeys
|
|||||||
set ttimeoutlen=20
|
set ttimeoutlen=20
|
||||||
set timeoutlen=1000
|
set timeoutlen=1000
|
||||||
|
|
||||||
" filetypes
|
" filetype autocmds
|
||||||
autocmd FileType markdown setlocal sw=4 ts=4 sts=4 expandtab
|
|
||||||
|
"markdown
|
||||||
|
augroup filetype_md
|
||||||
|
autocmd!
|
||||||
|
autocmd FileType markdown setlocal sw=4 ts=4 sts=4 expandtab
|
||||||
|
augroup END
|
||||||
|
|
||||||
|
"filestypes where tabs should = 2 spaces
|
||||||
|
augroup half_tab
|
||||||
|
autocmd!
|
||||||
|
autocmd FileType html,javascript,css,json,yaml,sh
|
||||||
|
\ setlocal ts=2 sts=2 sw=2 expandtab
|
||||||
|
augroup END
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user