Skip to content

Instantly share code, notes, and snippets.

@tompretty
Created March 2, 2018 10:19
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 tompretty/d5d15da1091713d0d05e282483fed5f5 to your computer and use it in GitHub Desktop.
Save tompretty/d5d15da1091713d0d05e282483fed5f5 to your computer and use it in GitHub Desktop.
vimrc
set nocompatible " required
filetype off " required
let mapleader = ","
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" let Vundle manage Vundle, required
Plugin 'gmarik/Vundle.vim'
" Add all your plugins here (note older versions of Vundle used Bundle instead of Plugin)
Bundle 'Valloric/YouCompleteMe'
Plugin 'nvie/vim-flake8'
Plugin 'Zenburn'
Plugin 'altercation/vim-colors-solarized'
Plugin 'scrooloose/syntastic'
Plugin 'scrooloose/nerdtree'
Plugin 'scrooloose/nerdcommenter'
Plugin 'vim-scripts/indentpython.vim'
Plugin 'tmhedberg/SimpylFold'
Plugin 'tpope/vim-fugitive'
Plugin 'Lokaltog/powerline', {'rtp': 'powerline/bindings/vim'}
Plugin 'octol/vim-cpp-enhanced-highlight'
Plugin 'kien/ctrlp.vim'
Plugin 'lervag/vimtex'
Plugin 'bfredl/nvim-ipy'
Plugin 'jpalardy/vim-slime'
" All of your Plugins must be added before the following line
call vundle#end() " required
filetype plugin indent on " required
colorscheme solarized
call togglebg#map("<F5>")
"split navigations
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>
set splitright
set splitbelow
" fast move lines
nnoremap ˚ :m.-2<CR>
nnoremap ∆ :m.+1<CR>
inoremap ˚ <Esc>:m.-2<CR>==gi
inoremap ∆ <Esc>:m.+1<CR>==gi
vnoremap ˚ :m '>+1<CR>gv=gv
vnoremap ∆ :m '<-2<CR>gv=gv
" insert line shortucs
nmap <C-O> O<Esc>
nmap <CR> o<Esc>
" nerd tree shortcut
nnoremap <C-N> :NERDTreeToggle<CR>
" nerd commenter settings
let g:NERDSpaceDelims = 1
let g:NERDCompactSexyComs = 1
let g:NERDDefaultAlign = 'left'
let g:NERDCommentEmptyLines = 1
let g:NERDTrimTrailingWhitespace = 1
" enable folding
set foldmethod=indent
set foldlevel=99
" enable folding with spacebar
nnoremap <space> za
" cplusplus and c settings
au BufNewFile,BufRead *.cpp,*.c,*.h
\ set tabstop=2 |
\ set softtabstop=2 |
\ set shiftwidth=2 |
\ set expandtab |
\ set textwidth=119 |
\ set colorcolumn=120 |
\ set autoindent |
\ set fileformat=unix
" python settings
au BufNewFile,BufRead *.py
\ set tabstop=4 |
\ set softtabstop=4 |
\ set shiftwidth=4 |
\ set textwidth=79 |
\ set colorcolumn=80 |
\ set expandtab |
\ set autoindent |
\ set fileformat=unix
set encoding=utf-8
let python_highlight_all = 1
syntax on
set nu
" you complete me settings
let g:ycm_server_keep_logfiles = 1
let g:ycm_server_log_level = 'debug'
" cpp enhanced highlight settings
let g:cpp_class_scope_highlight = 1
let g:cpp_member_variable_highlight = 1
let g:cpp_class_decl_highlight = 1
let g:cpp_experimental_simple_template_highlight = 1
" slime settings
let g:slime_target = "tmux"
let g:slime_paste_file = "$HOME/.slime_paste"
let g:slime_default_config = {"socket_name": split($TMUX, ",")[0], "target_pane": ":.2"}
let g:slime_python_ipython = 1
nmap <leader>s <Plug>SlimeMotionSend
nmap <leader>ss <Plug>SlimeLineSend
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment