sync/skel/.vimrc

354 lines
12 KiB
VimL
Raw Normal View History

2015-06-15 00:28:01 -04:00
"source /home/stonewareslord/.vim/autoload/plug.vim
2014-04-19 13:25:29 -04:00
if has('conceal')
set conceallevel=2 concealcursor=i
endif
2018-07-02 16:01:13 -04:00
"let g:formatdef_my_custom_cpp = '"astyle --mode=cpp -xc --style=google -j -s2 -xG -S -K -N -xn -xl -n -p -H"'
"let g:formatters_cpp = ['my_custom_cpp']
"let g:formatdef_my_custom_java = '"astyle --mode=java -xc --style=google -j -s2 -xG -S -K -N -xn -xl -n -p -H"'
"let g:formatters_java = ['my_custom_java']
"let g:UltiSnipsUsePythonVersion=3
2014-07-30 13:03:23 -04:00
command! WW %!sudo tee > /dev/null %
"TODO: Fix this
"let g:rbpt_loadcmd_toggle = 1
2018-07-02 16:01:13 -04:00
"let g:indent_guides_auto_colors = 0
2015-07-25 13:35:29 -04:00
autocmd VimEnter,Colorscheme * :hi IndentGuidesOdd guibg=darkgrey ctermbg=darkgrey
autocmd VimEnter,Colorscheme * :hi IndentGuidesEven guibg=grey ctermbg=grey
2015-08-03 10:46:02 -04:00
filetype plugin on
set grepprg=grep\ -nH\ $*
2018-07-02 16:01:13 -04:00
"let g:tex_flavor='latex'
2015-08-03 10:46:02 -04:00
"match Error /\s\+$/
2016-01-21 12:19:51 -05:00
" Basic, very important mappings {
" Movement {
"Vertical
2018-07-02 16:01:13 -04:00
noremap gj j
noremap gk k
noremap j gj
noremap k gk
2016-01-21 12:19:51 -05:00
"Horizontal
2018-07-02 16:01:13 -04:00
noremap H ^
2016-01-21 12:19:51 -05:00
nnoremap L $
vnoremap L $h
2018-07-02 16:01:13 -04:00
nnoremap Y y$
2016-01-21 12:19:51 -05:00
"Move to end of line
2016-02-14 16:36:31 -05:00
inoremap jk <End>
inoremap kj <End>
2016-01-21 12:19:51 -05:00
"Move to last character of last line
2018-07-02 16:01:13 -04:00
noremap G G$
noremap G G$
2016-01-21 12:19:51 -05:00
" }
" Buffers {
"Control-key movement
2018-07-02 16:01:13 -04:00
noremap <C-h> <C-w>h
noremap <C-j> <C-w>j
noremap <C-k> <C-w>k
noremap <C-l> <C-w>l
2016-01-21 12:19:51 -05:00
"Arrow keys
2018-07-02 16:01:13 -04:00
noremap <Up> <C-w>w
noremap <Down> <C-w>W
noremap <Left> :bp<CR>
noremap <Right> :bn<CR>
2016-01-21 12:19:51 -05:00
"Vertical and horizontal split
2018-07-02 16:01:13 -04:00
noremap <C-w>\| <C-w>v<C-w>l
noremap <C-w>- <C-w>s<C-w>j
2016-01-21 12:19:51 -05:00
"Close buffer
2018-07-02 16:01:13 -04:00
"noremap <C-d> <C-w>q
2016-01-21 12:19:51 -05:00
"Fullscreen buffer
2018-07-02 16:01:13 -04:00
noremap <C-w>z <C-w>_<C-w>\|
2016-01-21 12:19:51 -05:00
"Go to last buffer
2018-07-02 16:01:13 -04:00
noremap <Leader><Leader> <C-^>
2016-01-21 12:19:51 -05:00
" }
" Misc {
vnoremap <silent> * :call VisualSelection('f')<CR>
vnoremap <silent> # :call VisualSelection('b')<CR>
vnoremap ; :
vnoremap < <gv
vnoremap > >gv
2018-07-02 16:01:13 -04:00
noremap ! :!
2016-01-21 12:19:51 -05:00
"Disable F1
2018-07-02 16:01:13 -04:00
noremap <F1> <nop>
noremap! <F1> <nop>
2016-01-21 12:19:51 -05:00
"F2 toggle paste
2018-07-02 16:01:13 -04:00
noremap <F2> :set invpaste<CR>
2016-01-21 12:19:51 -05:00
"Better searching
2018-07-02 16:01:13 -04:00
noremap / /\v
2016-01-21 12:19:51 -05:00
"Addition and subtraction
2018-07-02 16:01:13 -04:00
"nnoremap + <C-a>
"nnoremap - <C-x>
2016-01-21 12:19:51 -05:00
"Backspace remove highlights
2018-07-02 16:01:13 -04:00
noremap <BS> :nohlsearch<CR>g<C-g>
2016-01-21 12:19:51 -05:00
"Better save
2018-07-02 16:01:13 -04:00
nnoremap <Enter> :up<CR>
2016-01-21 12:19:51 -05:00
"Unmap Q
2018-07-02 16:01:13 -04:00
noremap Q <Nop>
2016-01-21 12:19:51 -05:00
" }
" }
" Plugin mappings {
"Easymotion
map , <Plug>(easymotion-prefix)
"Ctrl-p
2018-07-02 16:01:13 -04:00
"nnoremap <Leader><C-p> :CtrlPFunky<CR>
2016-01-21 12:19:51 -05:00
"Gundo
2018-07-02 16:01:13 -04:00
"nnoremap <F5> :GundoToggle<CR>
2016-01-21 12:19:51 -05:00
"Easytags
2016-05-06 14:50:17 -04:00
"nnoremap <Leader><Space> :CtrlPTag<CR>
"Replacing easytags with ctrl p buffer
2018-07-02 16:01:13 -04:00
"nnoremap <Leader><Space> :CtrlPBuffer<CR>
2016-01-21 12:19:51 -05:00
"Tagbar
2016-01-28 16:44:03 -05:00
"nnoremap <Leader><Space> :Tagbar<CR>
2016-01-21 12:19:51 -05:00
"Add a bundle from clipboard
2018-07-02 16:01:13 -04:00
"nnoremap <Leader>bun G?Plug <CR>yyjp$hdi'"+gPo " \| <Esc>"+gp<Esc>:nohlsearch<CR>:up<CR>:PlugInstall
2016-01-21 12:19:51 -05:00
"Automatic if/else/for/while wrappers
nnoremap <Leader>if m"Oif(){<Esc>jo}<Esc>`"v><Esc>k^wa
nnoremap <Leader>else m"kAelse{<Esc>jo}<Esc>`"v><Esc>
nnoremap <Leader>for m"Ofor(){<Esc>jo}<Esc>`"v><Esc>k^wa
nnoremap <Leader>while m"Owhile(){<Esc>jo}<Esc>`"v><Esc>k^wa
nnoremap <Leader>rm m"kddjddkv<<Esc>`"
vnoremap <Leader>if <Esc>`<Oif(){<Esc>`>o}<Esc>gv><Esc>`<k^wa
vnoremap <Leader>else <Esc>`<kAelse{<Esc>`>o}<Esc>gv><Esc>
vnoremap <Leader>for <Esc>`<Ofor(){<Esc>`>o}<Esc>gv><Esc>`<k^wa
vnoremap <Leader>while <Esc>`<Owhile(){<Esc>`>o}<Esc>gv><Esc>`<k^wa
vnoremap <Leader>rm <Esc>`<<Esc>kdd`>jddgv<<Esc>
" }
" Trial mappings {
2018-07-02 16:01:13 -04:00
"nnoremap <Leader>o m`o<Esc>``
"nnoremap <Leader>O m`O<Esc>``
2016-01-21 12:19:51 -05:00
" }
" Gui options {
set gfn=Monospace\ 8
set guioptions=
2017-08-29 11:42:06 -04:00
"set guicursor+=n-v-c:blinkon0
set guicursor+=a:blinkon0
2016-01-21 12:19:51 -05:00
set mouse-=a
" }
" Annoyance fixes {
"Annoying escape timeouts
set ttimeout
set ttimeoutlen=0
set notimeout
2017-04-30 13:14:50 -04:00
set conceallevel=0
2016-01-21 12:19:51 -05:00
" }
" Misc {
2018-07-02 16:01:13 -04:00
set tabstop=2 softtabstop=2 shiftwidth=2 expandtab
2016-01-21 12:19:51 -05:00
set tags=./tags;/
set wildmode=longest,list,full
2018-07-02 16:01:13 -04:00
set formatoptions-=rot
2016-01-21 12:19:51 -05:00
set diffopt+=iwhite
set noesckeys
set modeline
set expandtab
2018-07-02 16:01:13 -04:00
set history=2048
2016-01-21 12:19:51 -05:00
set hidden
2016-07-25 03:53:50 -04:00
"set cursorline
2016-01-21 12:19:51 -05:00
set incsearch
set showmatch
set hlsearch
set scrolloff=3
set scrolljump=5
set autoindent
set backup
set backupdir=~/.vim/backup
set directory=~/.vim/tmp
2018-07-02 16:01:13 -04:00
set undolevels=2048
2016-01-21 12:19:51 -05:00
set ttyfast
set fileformat=unix
set encoding=utf-8
set laststatus=2
set foldmethod=indent
set foldnestmax=10
set foldlevel=2
set number
set background=dark
set t_Co=256
set gdefault
set nocompatible
set ignorecase
set textwidth=0
2018-07-02 16:01:13 -04:00
set path+=**
2016-01-21 12:19:51 -05:00
syntax on
" }
2017-04-30 13:14:50 -04:00
"Polyglot conflicts with another latex editor
let g:polyglot_disabled = ['latex']
2016-01-28 16:44:03 -05:00
"Signify
2015-06-23 20:26:25 -04:00
let g:signify_vcs_list = [ 'git', 'svn' ]
let g:signify_difftool = 'diff'
2016-01-28 16:44:03 -05:00
"CtrlP
2018-07-02 16:01:13 -04:00
"let g:ctrlp_root_markers = ['.cproot']
"let g:ctrlp_custom_ignore = {
" \ 'dir': '\v[\/](\.git|\.hg|\.svn|vendor)$',
" \ 'file': '\v\.(exe|so|dll|class)$',
" \ 'link': 'SOME_BAD_SYMBOLIC_LINKS',
" \ }
2016-01-28 16:44:03 -05:00
"Airline
2018-07-02 16:01:13 -04:00
"let g:airline_left_sep='▶'
"let g:airline_right_sep='◀'
"let g:airline#extensions#syntastic#enabled=0
"let g:ycm_show_diagnostics_ui=0
"let g:ycm_path_to_python_interpreter='/usr/bin/python2.7'
2017-08-14 01:19:54 -04:00
"let g:syntastic_cpp_compiler = 'clang++'
"let g:syntastic_cpp_compiler_options = ' -std=c++11 -stdlib=libc++'
2018-07-02 16:01:13 -04:00
"let g:syntastic_cpp_compiler_options = ' -std=c++11'
"let g:airline#extensions#whitespace#enabled=0
"let g:airline#extensions#whitespace#show_message=0
"let g:airline#extensions#tmuxline#enabled=1
2015-08-21 20:38:19 -04:00
"let g:formatprg_cpp="astyle"
"let g:formatprg_args_expr_cpp=" --mode=c --style=1tbs -xe -k1 -j"
2014-06-16 09:42:03 -04:00
" These flags don't work for some reason
2014-04-19 13:25:29 -04:00
" -xn -xc -xl -S
2016-01-21 12:19:51 -05:00
"inoremap <expr><Tab> pumvisible() ? "\<C-n>" : "\<Tab>"
"inoremap <Tab> pumvisible() ? "\<C-n>" : "\<Tab>"
2018-07-02 16:01:13 -04:00
"let g:UltiSnipsJumpForwardTrigger="<C-S-Q>"
"let g:UltiSnipsExpandTrigger="<S-Tab>"
"let g:UltiSnipsListSnippets="<C-e>"
"let g:UltiSnipsEditSplit="vertical"
inoremap <expr> <CR> pumvisible() ? "\<C-y>" : "\<C-g>u\<CR>"
filetype off
if has("win32")
call plug#begin('~/vimfiles/plugged')
else
call plug#begin('~/.vim/plugged')
endif
2016-01-21 12:19:51 -05:00
" Code writing {
2018-07-02 16:01:13 -04:00
"Plug 'https://gitea.austenwares.com/vim/vim-autoformat', { 'on': 'Autoformat'}
2016-01-21 12:19:51 -05:00
"Adds autoformat command | https://github.com/Chiel92/vim-autoformat
2018-01-14 23:58:31 -05:00
Plug 'https://gitea.austenwares.com/vim/vim-surround'
2016-01-21 12:19:51 -05:00
"Surround selection in ({\"' or HTML tags | https://github.com/tpope/vim-surround
2018-07-02 16:01:13 -04:00
"Plug 'https://gitea.austenwares.com/vim/syntastic'
2016-01-21 12:19:51 -05:00
"Syntax checker | https://github.com/scrooloose/syntastic
2018-07-02 16:01:13 -04:00
"Plug 'https://gitea.austenwares.com/vim/nerdtree', { 'on': 'NERDTreeToggle' }
2016-01-21 12:19:51 -05:00
"File browser | https://github.com/scrooloose/nerdtree
2018-01-14 23:58:31 -05:00
Plug 'https://gitea.austenwares.com/vim/vim-easymotion'
2016-01-21 12:19:51 -05:00
"Move around quickly in a document | https://github.com/Lokaltog/vim-easymotion
2018-01-14 23:58:31 -05:00
"Plug 'https://gitea.austenwares.com/vim/gundo.vim', { 'on': 'GundoToggle' }
2016-01-21 12:19:51 -05:00
"Visual undo | https://github.com/sjl/gundo.vim
2018-07-02 16:01:13 -04:00
"Plug 'https://gitea.austenwares.com/vim/vim-exchange'
2016-01-21 12:19:51 -05:00
"Exchange two selections of text | https://github.com/tommcdo/vim-exchange
2018-07-02 16:01:13 -04:00
"Plug 'https://gitea.austenwares.com/vim/vim-repeat'
2016-01-21 12:19:51 -05:00
"Repeat last tpope command with . | https://github.com/tpope/vim-repeat
2018-07-02 16:01:13 -04:00
"Plug 'https://gitea.austenwares.com/vim/vim-fugitive'
2016-01-21 12:19:51 -05:00
"Great Vim-Git compatibility | https://github.com/tpope/vim-fugitive
2018-07-07 00:07:24 -04:00
Plug 'https://gitea.austenwares.com/vim/ctrlp.vim'
2016-01-21 12:19:51 -05:00
"Fuzzy file search | https://github.com/kien/ctrlp.vim
2018-01-14 23:58:31 -05:00
Plug 'https://gitea.austenwares.com/vim/tabular', { 'on': 'Tab' }
2016-01-21 12:19:51 -05:00
"Quickly make tables in vim | https://github.com/godlygeek/tabular
2018-07-02 16:01:13 -04:00
"Plug 'https://gitea.austenwares.com/vim/UltiSnips'
2016-10-12 23:42:35 -04:00
"Adds snippet support | https://github.com/sirver/UltiSnips
2018-07-02 16:01:13 -04:00
"Plug 'https://gitea.austenwares.com/vim/vim-snippets'
2016-10-12 23:42:35 -04:00
"Add snippets | https://github.com/honza/vim-snippets
2018-01-14 23:58:31 -05:00
Plug 'https://gitea.austenwares.com/vim/eregex.vim'
2016-01-21 12:19:51 -05:00
"Real regexes in vim | https://github.com/othree/eregex.vim
2018-01-14 23:58:31 -05:00
Plug 'https://gitea.austenwares.com/vim/vim-signify'
2016-01-21 12:19:51 -05:00
"Git information inline | https://github.com/mhinz/vim-signify
2018-01-14 23:58:31 -05:00
Plug 'https://gitea.austenwares.com/vim/auto-pairs'
2016-01-21 12:19:51 -05:00
"Automatic pairs | https://github.com/jiangmiao/auto-pairs
2018-07-02 16:01:13 -04:00
"Plug 'https://gitea.austenwares.com/vim/YouCompleteMe'
2016-03-29 17:12:47 -04:00
"Autocompletion | https://github.com/Valloric/YouCompleteMe
2018-01-14 23:58:31 -05:00
"Plug 'https://gitea.austenwares.com/vim/vim-java-getset.git'
"Java getters and setters| https://gitea.austenwares.com/vim/vim-java-getset.git
2018-07-02 16:01:13 -04:00
"Plug 'https://gitea.austenwares.com/vim/double-tap.git'
2016-05-22 13:52:20 -04:00
"Double tap for comments
2016-01-21 12:19:51 -05:00
" }
" Style {
2018-01-14 23:58:31 -05:00
"Plug 'https://gitea.austenwares.com/vim/vim-indent-guides'
2016-01-21 12:19:51 -05:00
"Indentation guides | https://github.com/nathanaelkane/vim-indent-guides
2018-01-14 23:58:31 -05:00
"Plug 'https://gitea.austenwares.com/vim/vim-airline'
2016-01-21 12:19:51 -05:00
"Bottom status bar | https://github.com/bling/vim-airline
2018-01-14 23:58:31 -05:00
Plug 'https://gitea.austenwares.com/vim/vim-colors'
2016-01-21 12:19:51 -05:00
"Theme pack | https://github.com/spf13/vim-colors
2018-01-14 23:58:31 -05:00
Plug 'https://gitea.austenwares.com/vim/csapprox'
2016-01-21 12:19:51 -05:00
"256 color vim in terminal | https://github.com/godlygeek/csapprox
" }
" Syntax {
2018-07-02 16:01:13 -04:00
"Plug 'https://gitea.austenwares.com/vim/vimtex'
2017-04-30 13:14:50 -04:00
"Latex | https://github.com/lervag/vimtex
2018-01-14 23:58:31 -05:00
Plug 'https://gitea.austenwares.com/vim/vim-polyglot'
"Many languages | https://github.com/sheerun/vim-polyglot
2018-07-02 16:01:13 -04:00
"Plug 'https://gitea.austenwares.com/vim/vim-vimperator'
2016-01-21 12:19:51 -05:00
"Vimperator for vim | https://github.com/superbrothers/vim-vimperator
2018-07-02 16:01:13 -04:00
"Plug 'https://gitea.austenwares.com/vim/i3-vim-syntax'
2016-01-21 12:19:51 -05:00
"i3 syntax | https://github.com/PotatoesMaster/i3-vim-syntax
" }
" Misc {
2018-07-02 16:01:13 -04:00
"Plug 'https://gitea.austenwares.com/vim/flappyvird-vim', { 'on': [] }
2016-01-21 12:19:51 -05:00
"The amazing Flappy Bird game | https://github.com/mattn/flappyvird-vim
2018-07-02 16:01:13 -04:00
"Plug 'https://gitea.austenwares.com/vim/vim-gnupg'
2016-01-21 12:19:51 -05:00
"GPG support | https://github.com/jamessan/vim-gnupg
2018-01-14 23:58:31 -05:00
Plug 'https://gitea.austenwares.com/vim/vim-bracketed-paste'
2016-08-21 15:04:53 -04:00
"Automatic :set paste funcationality | https://github.com/ConradIrwin/vim-bracketed-paste
2018-07-02 16:01:13 -04:00
"Plug 'https://gitea.austenwares.com/vim/HiCursorWords'
2017-02-14 01:43:35 -05:00
"Highlight word under cursor automatically | http://www.vim.org/scripts/script.php?script_id=4306
2018-07-02 22:22:26 -04:00
"Plug 'https://github.com/chrisbra/NrrwRgn'
"Narrow region | https://github.com/chrisbra/NrrwRgn
2016-01-21 12:19:51 -05:00
" }
" Unused {
2018-01-14 23:58:31 -05:00
"Plug 'https://gitea.austenwares.com/vim/mirror.vim'
2016-02-14 13:55:10 -05:00
" "Edit files remotely | https://github.com/zenbro/mirror.vim
2016-01-21 12:19:51 -05:00
" }
2016-10-12 23:42:35 -04:00
" Staging {
2018-01-14 23:58:31 -05:00
"Plug 'https://gitea.austenwares.com/vim/vim-symfony'
2017-04-30 13:14:50 -04:00
"Plug 'dracula/vim'
"Plug 'idanarye/vim-vebugger'
2016-10-12 23:42:35 -04:00
"Debugger | https://github.com/idanarye/vim-vebugger
" }
call plug#end()
2014-04-19 13:25:29 -04:00
filetype plugin indent on
if exists("+undofile")
if isdirectory($HOME . '/.vim/undo')==0
2014-04-19 13:25:29 -04:00
:silent !mkdir -p ~/.vim/undo > /dev/null 2>&1
endif
2018-07-02 16:01:13 -04:00
set undodir=~/.vim/undo/
2014-04-19 13:25:29 -04:00
set undofile
endif
2015-06-23 10:24:46 -04:00
augroup autosave
au!
au BufWritePost .vimrc,vimrc source %
2015-06-23 10:24:46 -04:00
au BufWritePost .Xresources,Xresources silent! !xrdb %
augroup END
2014-04-19 13:25:29 -04:00
augroup vimrcEx
au!
" When editing a file, always jump to the last known cursor position.
autocmd BufReadPost *
\ if line("'\"") > 0 && line("'\"") <=line("$") |
2014-04-19 13:25:29 -04:00
\ exe "normal g`\"" |
\ endif
augroup END
2018-07-02 16:01:13 -04:00
"if has('gui_running')
" set guioptions-=T
"else
" set t_Co=256
"endif
silent! colorscheme fruity
function! Initialize()
if has("win32")
2017-11-27 11:45:01 -05:00
cd ~
silent !mkdir vimfiles
cd vimfiles
silent !mkdir autoload
silent !mkdir plugin
silent !mkdir backup
silent !mkdir undo
silent !mkdir tmp
cd autoload
silent !powershell -command "& { iwr https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim -OutFile plug.vim }"
silent! so ~/_vimrc
else
2018-07-07 00:07:24 -04:00
silent !mkdir -p ~/.vim/autoload ~/.vim/plugin ~/.vim/backup ~/.vim/undo ~/.vim/tmp
2017-11-27 11:45:01 -05:00
silent !curl -fLo ~/.vim/autoload/plug.vim https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
silent! so ~/.vimrc
endif
2018-07-07 00:07:24 -04:00
silent PlugClean!
silent PlugInstall!
silent PlugUpdate!
2017-11-27 11:45:01 -05:00
q
endfunction
2017-08-29 11:42:06 -04:00
set guifont=Gohu\ GohuFont
2018-07-02 16:01:13 -04:00
"inoremap <Tab> <C-R>=g:UltiSnips_Complete()<cr>
"map <unique> <buffer> <LocalLeader>b <Plug>JavagetsetInsertBothGetterSetter
"map <Leader>a O<Esc>:Autoformat<CR>:v/\S/d<CR>:nohlsearch<CR>
"inoremap <expr> <CR> getline(".") =~ '^\s*\([#"]\)\s*$' ? "\<C-u>" : "\<CR>"