Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- hist(someVariable)
- set omnifunc=syntaxcomplete#Complete
- " Map leader
- let mapleader = ","
- let maplocalleader = ","
- " Plug in manager
- call plug#begin('~/.vim/plugged')
- " Make sure you use single quotes
- " Any valid git URL is allowed
- Plug 'https://github.com/junegunn/vim-github-dashboard.git'
- Plug 'jalvesaq/Nvim-R'
- Plug 'yegappan/mru'
- Plug 'godlygeek/tabular'
- Plug 'plasticboy/vim-markdown'
- Plug 'chrisbra/csv.vim'
- Plug 'scrooloose/nerdtree'
- Plug 'altercation/vim-colors-solarized'
- " Plug 'ervandew/supertab'
- Plug 'jalvesaq/southernlights'
- Plug 'kshenoy/vim-signature'
- Plug 'chrisbra/csv.vim'
- Plug 'vim-airline/vim-airline'
- Plug 'ryanoasis/vim-devicons'
- Plug 'scrooloose/nerdcommenter'
- Plug 'WolfgangMehner/c-support'
- " Plug 'kien/ctrlp.vim'
- Plug 'garbas/vim-snipmate'
- Plug 'MarcWeber/vim-addon-mw-utils'
- Plug 'tomtom/tlib_vim'
- Plug 'honza/vim-snippets'
- Plug 'mhinz/vim-startify'
- Plug 'majutsushi/tagbar'
- Plug 'bling/vim-bufferline'
- Plug 'vim-airline/vim-airline-themes'
- Plug 'easymotion/vim-easymotion'
- Plug 'mbbill/undotree'
- Plug 'luochen1990/rainbow'
- Plug 'junegunn/vim-easy-align'
- Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
- Plug 'ervandew/screen'
- Plug 'itchyny/calendar.vim'
- Plug 'tpope/vim-obsession'
- Plug 'terryma/vim-multiple-cursors'
- Plug 'agude/vim-eldar'
- Plug 'whatyouhide/vim-gotham'
- Plug 'hhsnopek/vim-firewatch'
- Plug 'trusktr/seti.vim'
- Plug 'tpope/vim-fugitive'
- Plug 'tmhedberg/SimpylFold'
- Plug 'nvie/vim-flake8'
- Plug 'jistr/vim-nerdtree-tabs'
- Plug 'vim-syntastic/syntastic'
- " Plug 'othree/vim-autocomplpop'
- " Plug 'eparreno/vim-l9'
- " Add plugins to &runtimepath
- call plug#end()
- " Configure NERD fonts
- set encoding=utf8
- " set guifont=Droid Sans Mono for Powerline Plus Nerd File Types:h11
- " Set font for the airline
- let g:airline_powerline_fonts = 1
- let g:airline_theme='solarized'
- " Rainbow parentheses
- let g:rainbow_active = 1 " 0 if you want to enable it later via :RainbowToggle
- " Set spelling language
- set spell spelllang=en_gb
- """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
- """"""""""""""""""""""""" KEY MAPPINGS """"""""""""""""""""""""""""""""""""""""
- """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
- " Map keys to moving lines up and down
- " move selected lines up one line
- xnoremap <C-Up> :m-2<CR>gv=gv
- " move selected lines down one line
- xnoremap <C-Down> :m'>+<CR>gv=gv
- " Map tagbar
- nmap <F8> :TagbarToggle<CR>
- " Add F7 to insert timestamp with current date
- nnoremap <F7> "=strftime("%c")<CR>P
- inoremap <F7> <C-R>=strftime("%c")<CR>
- " Press F4 to toggle highlighting on/off, and show current value.
- noremap <F4> :set hlsearch! hlsearch?<CR>
- " move vertically by visual line
- nnoremap j gj
- nnoremap k gk
- " ColorStepper Keys
- nmap <F10> <Plug>ColorstepPrev
- nmap <F11> <Plug>ColorstepNext
- nmap <S-F11> <Plug>ColorstepReload
- " Move between splits
- " Ctrl-j move to the split below
- " Ctrl-k move to the split above
- " Ctrl-l move to the split to the right
- " Ctrl-h move to the split to the left
- nnoremap <C-J> <C-W><C-J>
- nnoremap <C-K> <C-W><C-K>
- nnoremap <C-L> <C-W><C-L>
- nnoremap <C-H> <C-W><C-H>
- " Toggle syntastic checking
- let g:syntastic_mode_map = { 'mode': 'passive', 'active_filetypes': [],'passive_filetypes': [] }
- nnoremap <C-w>E :SyntasticCheck<CR> :SyntasticToggleMode<CR>
- " Toggle undo tree
- nnoremap <F5> :UndotreeToggle<cr>
- " Compile and run things
- autocmd filetype python nnoremap <F9> :w <bar> exec '!python '.shellescape('%')<CR>
- autocmd filetype c nnoremap <F9> :w <bar> exec '!gcc '.shellescape('%').' -o '.shellescape('%:r').' && ./'.shellescape('%:r')<CR>
- autocmd filetype cpp nnoremap <F9> :w <bar> exec '!g++ '.shellescape('%').' -o '.shellescape('%:r').' && ./'.shellescape('%:r')<CR>
- " Start EasyAlign
- " Start interactive EasyAlign in visual mode (e.g. vipga)
- xmap ga <Plug>(EasyAlign)
- " Start interactive EasyAlign for a motion/text object (e.g. gaip)
- nmap ga <Plug>(EasyAlign)
- """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
- """"""""""""""""""""""""""" VIM SETTINGS """"""""""""""""""""""""""""""""""""""
- """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
- " Colour scheme support
- set term=xterm-256color
- " C-support settings
- let g:C_UseTool_cmake = 'yes'
- let g:C_UseTool_doxygen = 'yes'
- " Set persistent undo file
- set undodir=~/.vim/vimundo
- set undofile
- " Switch on syntax highlighting
- " syntax on
- " Switch on syntax processing
- syntax enable
- " Other useful settings
- set nocompatible
- set number
- set autoindent
- " Set backspace
- set backspace=2 " make backspace work like most other apps"
- " Force deletion of whole word with backspace
- imap <C-BS> <C-W>"
- " Useful syntax settings
- syntax enable
- filetype plugin on
- filetype indent on
- " Set colour scheme
- set background=dark
- colorscheme solarized
- " Matching
- set showmatch
- " Spaces and tabs
- set tabstop=4
- set softtabstop=4
- " Other UI settings
- set showcmd
- set cursorline " Show cursor line
- set laststatus=2
- " Don't fail on error
- set confirm
- " Enable mouse
- set mouse=a
- " Better autocomplete
- set wildmenu
- " Search when types
- set incsearch
- " Fix case
- set ignorecase
- set smartcase
- " Ruler
- set ruler
- " Set better search options
- set incsearch
- set hlsearch
- " Enable folding
- set foldenable
- " Most folds open by default
- set foldlevelstart=10
- " Maximum folds
- set foldnestmax=10
- " Folds based on indent
- set foldmethod=syntax
- " Autocompletion
- " set omnifunc=syntaxcomplete#Complete
- " highlight last inserted text
- nnoremap gV `[v`]
- " Set vertical line
- if exists('+colorcolumn')
- set colorcolumn=80
- else
- au BufWinEnter * let w:m2=matchadd('ErrorMsg', '%>80v.+', -1)
- endif
- " Disable automatic comment insertion
- autocmd FileType * setlocal formatoptions-=c formatoptions-=r formatoptions-=o
- " Python indentation
- au BufNewFile,BufRead *.py
- set tabstop=4
- set softtabstop=4
- set shiftwidth=4
- set textwidth=79
- set expandtab
- set autoindent
- set fileformat=unix
- """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
- """""""""""""""""""""""""""" Plug-ins """""""""""""""""""""""""""""""""""""""""
- """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
- " Nvim-R extra settings
- " Change assignment operator
- let R_assign_map = "__"
- " Configure vertical split
- let R_vsplit = 1
- let R_tmux_split = 1
- " Space to send current line
- vmap <Space> <Plug>RDSendSelection
- nmap <Space> <Plug>RDSendLine
- " Configure vertical split for R
- " Configuration taken from http://manuals.bioinformatics.ucr.edu/home/programming-in-r/vim-r
- let vimrplugin_screenvsplit = 1 " For vertical tmux split
- let g:ScreenShellInitialFocus = 'shell'
- " instruct to use your own .screenrc file
- let g:vimrplugin_noscreenrc = 1
- " For integration of r-plugin with screen.vim
- let g:vimrplugin_screenplugin = 1
- " Don't use conque shell if installed
- let vimrplugin_conqueplugin = 0
- " map the letter 'r' to send visually selected lines to R
- let g:vimrplugin_map_r = 1
- " see R documentation in a Vim buffer
- let vimrplugin_vimpager = "no"
- " NERD commenter extra settings
- " Add spaces after comment delimiters by default
- let g:NERDSpaceDelims = 1
- " Use compact syntax for prettified multi-line comments
- let g:NERDCompactSexyComs = 1
- " Align line-wise comment delimiters flush left instead of following code indentation
- let g:NERDDefaultAlign = 'left'
- " Set a language to use its alternate delimiters by default
- let g:NERDAltDelims_java = 1
- " Add your own custom formats or override the defaults
- let g:NERDCustomDelimiters = { 'c': { 'left': '/**','right': '*/' } }
- " Allow commenting and inverting empty lines (useful when commenting a region)
- let g:NERDCommentEmptyLines = 1
- " Enable trimming of trailing whitespace when uncommenting
- let g:NERDTrimTrailingWhitespace = 1
- " Enable tabline extension in airline
- let g:airline#extensions#tabline#enabled = 1
- " Syntastic
- let g:syntastic_enable_r_lintr_checker = 1
- let g:syntastic_r_checkers = ['lintr']
- " Syntastic recommended settings
- set statusline+=%#warningmsg#
- set statusline+=%{SyntasticStatuslineFlag()}
- set statusline+=%*
- let g:syntastic_always_populate_loc_list = 1
- let g:syntastic_auto_loc_list = 1
- let g:syntastic_check_on_open = 1
- let g:syntastic_check_on_wq = 0
- """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
- """"""""""""""""""""""""""" FUNCTIONS """""""""""""""""""""""""""""""""""""""""
- """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
- " Single compile
- au BufEnter *.cpp set makeprg=g++ -g % -o %<
- au BufEnter *.c set makeprg=gcc -g % -o %<
- au BufEnter *.py set makeprg=python %
- au BufEnter *.[rR] set makeprg=Rscript %
- map <F9> :call CompileGcc()<CR>
- func! CompileGcc()
- exec "w"
- silent make
- endfunc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement