Skip to content

Instantly share code, notes, and snippets.

@victorcbr
Created July 29, 2019 12:58
Show Gist options
  • Save victorcbr/d575f4d224729e894926f685ea0a18a7 to your computer and use it in GitHub Desktop.
Save victorcbr/d575f4d224729e894926f685ea0a18a7 to your computer and use it in GitHub Desktop.
.vimrc
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
if empty(glob('~/.vim/autoload/plug.vim'))
silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
endif
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
" let Vundle manage Vundle, required
Plugin 'kaicataldo/material.vim'
Plugin 'VundleVim/Vundle.vim'
Plugin 'baabelfish/nim.vim'
Plugin 'zweifisch/pipe2eval'
Plugin 'tommcdo/vim-exchange'
Plugin 'scrooloose/syntastic'
Plugin 'derekwyatt/vim-scala'
" All of your Plugins must be added before the following line
call vundle#end() " required
filetype plugin indent on " required
" Brief help
" :PluginList - lists configured plugins
" :PluginInstall - installs plugins; append `!` to update or just :PluginUpdate
" :PluginSearch foo - searches for foo; append `!` to refresh local cache
" :PluginClean - confirms removal of unused plugins; append `!` to auto-approve removal
"
" see :h vundle for more details or wiki for FAQ
" Put your non-Plugin stuff after this line
set encoding=utf-8
let mapleader = ","
" Set to auto read when a file is changed from the outside
set autoread
" Fast saving
nmap <leader>w :w!<cr>
" :W sudo saves the file
" (useful for handling the permission-denied error)
command W w !sudo tee % > /dev/null
" When searching try to be smart about cases
set smartcase
" Highlight search results
set hlsearch
" Makes search act like search in modern browsers
set incsearch
" Don't redraw while executing macros (good performance config)
set lazyredraw
" Aesthetics
syntax enable
colorscheme material
set background=dark
" Fix bad autoindent of pasted text
set paste
" Show line numbers
set number
nnoremap <leader>n :set nonumber!<CR>
" Format json on the fly
nnoremap <leader>fj :%!python -m json.tool
" Jump to last position on opening
if has("autocmd")
au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$") | exe "normal! g'\"" | endif
endif
" == Syntastic Plugin Config
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
" == Nim Syntax Plugin
fun! JumpToDef()
if exists("*GotoDefinition_" . &filetype)
call GotoDefinition_{&filetype}()
else
exe "norm! \<C-]>"
endif
endf
" Jump to tag
nn <M-g> :call JumpToDef()<cr>
ino <M-g> <esc>:call JumpToDef()<cr>i
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment