Skip to content

Instantly share code, notes, and snippets.

@DoxasticFox
Created July 11, 2018 00:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DoxasticFox/f6ffc226feb27ef478b9b970e4eeeac1 to your computer and use it in GitHub Desktop.
Save DoxasticFox/f6ffc226feb27ef478b9b970e4eeeac1 to your computer and use it in GitHub Desktop.
set nocompatible
set lazyredraw
filetype off
set splitbelow
set splitright
let g:skip_xpath = 1
let g:ycm_min_num_of_chars_for_completion = 2
let g:ycm_error_symbol = '>'
let g:ycm_warning_symbol = '>'
let g:ycm_global_ycm_extra_conf = '/home/christian/.vim/bundle/YouCompleteMe/.ycm_extra_conf.py'
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTreeType") && b:NERDTreeType == "primary") | q | endif
let NERDTreeIgnore = ['\.pyc$']
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'gmarik/Vundle.vim'
Plugin 'Valloric/YouCompleteMe'
Plugin 'majutsushi/tagbar'
call vundle#end()
set backupdir=/tmp
set path+=/usr/include
set path+=/usr/include/c++/4.8.2
set path+=/usr/local/include/vtk-6.0
set path+=/usr/local/include/ITK-4.6
set path+=/usr/include/qt4/QtGui
set path+=/usr/local/CTK/CTK-superbuild/CTK-build/Libs/Widgets
set path+=/usr/local/CTK/CTK/Libs/Widgets
set path+=/usr/local/CTK/CTK/Libs/Core
set updatetime=200
scriptencoding utf-8
set encoding=utf-8
set formatprg=astyle\ --indent=tab\ --style=kr\ --pad-oper\ --pad-header\ --add-brackets\ --close-templates\ --max-code-length=80
hi WarningMsg ctermfg=white ctermbg=red guifg=White guibg=Red gui=None
"set nowrapscan
set showcmd
"set scrolloff=999
let &colorcolumn=join(range(81,999),",")
" Regular line numbers in insert mode, relative other times
set number
"set relativenumber
"autocmd InsertEnter * :set norelativenumber | set number
"autocmd InsertLeave * :set relativenumber | set nonumber
let mapleader=" "
nnoremap Y y$
noremap <leader>p :set paste<CR>i
noremap <leader>np <ESC>:set nopaste<CR>
noremap <leader>q :q<CR>
noremap <leader>Q :q!<CR>
noremap <leader>ww :w<CR>
noremap <leader>wq :wq<CR>
noremap <leader>a ggvG$
noremap <leader>y "+y
noremap <leader>yy "+Y
vnoremap /r ""y:.,$s/<C-r>=escape(@", '/\')<CR>//cg<Left><Left><Left>
vnoremap /f y/<C-r>=escape(@", '/\')<CR><CR>
noremap <F6> :NERDTreeToggle<CR>
nnoremap <F7> :TagbarToggle<CR>
nnoremap <F8> :call ToggleNERDTreeAndTagbar()<CR>
"nnoremap <F5> :call AutoHighlightToggle()<CR>
nnoremap <leader>g :YcmCompleter GoToDefinitionElseDeclaration<CR>
if has("wildmenu")
set wildmenu
set wildmode=longest:full,full
set wildignore+=*.a,*.o,*.so
set wildignore+=*.bmp,*.gif,*.ico,*.jpg,*.png
set wildignore+=.DS_Store,.git,.hg,.svn
set wildignore+=*~,*.swp,*.tmp
endif
setlocal spell spelllang=en_au
syntax enable
filetype plugin on
filetype plugin indent on
set nofoldenable
"setlocal foldmethod=syntax
"setlocal foldnestmax=1
"setlocal foldtext=Customfold()
set autoindent
set showbreak=····
set expandtab
set tabstop=2
set shiftwidth=2
set showbreak=····
autocmd Filetype * set expandtab
autocmd Filetype * set tabstop=2
autocmd Filetype * set shiftwidth=2
autocmd BufEnter *.py set tabstop=4
autocmd BufEnter *.py set shiftwidth=4
autocmd BufEnter *.bsh set ft=java
autocmd BufEnter *.bsh set tabstop=2
autocmd BufEnter *.bsh set shiftwidth=2
autocmd BufEnter *.bsh set expandtab
autocmd BufEnter *.bsh :IndentGuidesDisable
autocmd Filetype xslt set tabstop=2
autocmd Filetype xslt set shiftwidth=2
autocmd Filetype xslt set expandtab
autocmd Filetype xml set tabstop=2
autocmd Filetype xml set shiftwidth=2
autocmd Filetype xml set expandtab
autocmd Filetype xsd set tabstop=2
autocmd Filetype xsd set shiftwidth=2
autocmd Filetype xsd set expandtab
autocmd Filetype html,xml,xsl,xslt,xsd source ~/.vim/plugin/closetag.vim
autocmd Filetype html,xml,xml,xslt,xsd inoremap <buffer> ,/ <C-R>=GetCloseTag()<CR>
autocmd BufEnter *.xml :IndentGuidesEnable
autocmd BufEnter *.xsd :IndentGuidesEnable
autocmd BufEnter *.xsl :IndentGuidesEnable
autocmd BufEnter *.xslt :IndentGuidesEnable
autocmd BufEnter *.hml :IndentGuidesEnable
autocmd BufEnter *.html :IndentGuidesEnable
autocmd BufNewFile,BufRead *.tex set ft=tex
autocmd BufNewFile,BufRead *.tex set tabstop=2
autocmd BufNewFile,BufRead *.tex set shiftwidth=2
autocmd BufNewFile,BufRead *.tex set showbreak=··
autocmd BufNewFile,BufRead *.tex set colorcolumn=
set incsearch
set hls
set t_Co=16
set background=light
colorscheme solarized
set cursorline
hi CursorLineNr ctermbg=black
set list
set listchars=tab:»·,trail:·
hi SpecialKey cterm=NONE
" Don't overwrite clipboard upon pasting in visual mode
function! RestoreRegister()
let @" = s:restore_reg
return ''
endfunction
function! s:Repl()
let s:restore_reg = @"
return "p@=RestoreRegister()\<cr>"
endfunction
vmap <silent> <expr> p <sid>Repl()
" FAIMS STUFF
autocmd BufWritePost * :call UploadToFaims()
fun! UploadToFaims()
if !filereadable("./upload.sh")
return
endif
call system("./upload.sh >/tmp/upload-to-faims-output &")
"call CheckUploadStatus()
endfun
nnoremap <F5> :call CheckUploadStatus()<CR>
fun! CheckUploadStatus()
exe "noautocmd botright pedit /tmp/upload-to-faims-output"
noautocmd wincmd P
resize 4
edit!
"noautocmd wincmd p
endfun
"autocmd CursorHold * checktime
"autocmd CursorHold * call EventLoop()
"function! EventLoop()
"call feedkeys("f\e")
"call system("touch /tmp/upload-to-faims-output")
"endfunction
"
"
"func! STL()
"let stl = '%f [%{(&fenc==""?&enc:&fenc).((exists("+bomb") && &bomb)?",B":"")}%M%R%H%W] %y [%l/%L,%v] [%p%%]'
"let barWidth = &columns - 65 " <-- wild guess
"let barWidth = barWidth < 3 ? 3 : barWidth
"if line('$') > 1
"let progress = (line('.')-1) * (barWidth-1) / (line('$')-1)
"else
"let progress = barWidth/2
"endif
"" line + vcol + %
"let pad = strlen(line('$'))-strlen(line('.')) + 3 - strlen(virtcol('.')) + 3 - strlen(line('.')*100/line('$'))
"let bar = repeat(' ',pad).' [%1*%'.barWidth.'.'.barWidth.'('
"\.repeat('-',progress )
"\.'%2*0%1*'
"\.repeat('-',barWidth - progress - 1).'%0*%)%<]'
"return stl.bar
"endfun
"hi def link User1 DiffAdd
"hi def link User2 DiffDelete
"set stl=%!STL()
"set laststatus=2
hi Normal ctermbg=none
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment