Skip to content

Instantly share code, notes, and snippets.

@jakab922
Created October 6, 2017 05:18
Show Gist options
  • Save jakab922/4193c7b8847efe78cdfc0606405dca05 to your computer and use it in GitHub Desktop.
Save jakab922/4193c7b8847efe78cdfc0606405dca05 to your computer and use it in GitHub Desktop.
my vimrc for now
" Vundle setup
set nocompatible
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'dyng/ctrlsf.vim'
Plugin 'vim-syntastic/syntastic'
Plugin 'tomtom/tlib_vim'
Plugin 'toml-lang/toml'
Plugin 'Shougo/unite.vim'
Plugin 'MarcWeber/vim-addon-mw-utils'
Plugin 'tshirtman/vim-cython'
Plugin 'Shougo/vimfiler.vim'
Plugin 'tpope/vim-fugitive'
Plugin 'fatih/vim-go'
Plugin 'garbas/vim-snipmate'
Plugin 'honza/vim-snippets'
Plugin 'nsf/gocode', {'rtp': 'vim/'}
Plugin 'rust-lang/rust.vim'
Plugin 'autowitch/hive.vim'
call vundle#end()
" Basic options
filetype plugin indent on
syntax on
set encoding=utf-8
" Setting the colorscheme
" colorscheme jellybeans
" colorscheme garden
colorscheme github
" When focus is lost all files are written
set autowriteall
" Displaying the status line. This is needed for Powerline.
set laststatus=2
" Use 256 colors. Again for the Powerline setup
set t_Co=256
" Adding powerline to the rtp
set rtp+=/usr/lib/python2.7/site-packages/powerline/bindings/vim/
" Setting up the ag plugin to search from the root of the project.
let g:ag_working_path_mode="r"
" Ag and Ack connection
if executable('ag')
let g:ackprg = 'ag --vimgrep'
endif
" Setup for syntastic
set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*
let g:syntastic_always_populate_loc_list = 0
let g:syntastic_auto_loc_list = 0
let g:syntastic_check_on_open = 0
let g:syntastic_check_on_wq = 0
let g:syntastic_mode_map = {
\ "mode": "passive",
\ "active_filetypes": [],
\ "passive_filetypes": [] }
" Let vimfiler be the default file explorer
let g:vimfiler_as_default_explorer = 1
" Setting up the wildmenu
set wildmenu
set wildmode=longest:full,full
" Haskell related settings
set tabstop=8
set expandtab
set softtabstop=4
set shiftwidth=4
set shiftround
" Relative numbering of files
set relativenumber
" Making typinh jk work like typing escape
inoremap jk <ESC>
" Mapping U to do redo
nmap U <c-r>
" Highlight search results
set hlsearch
" Set spelling to US
set spell spelllang=en_us
" And turn it off
set nospell
" remap testing
nnoremap <leader>s :set spell!
" Adding a python function for Spanish exercise templates
function! SpanishTemplate(arg)
python << endpython
import vim
buf = vim.current.buffer
last_letter = vim.eval("a:arg")
line = 0
for num in xrange(97, 122):
letter = chr(num)
buf[line:(line + 4)] = [
"%s)" % letter,
"- ¿?",
"- .",
"*"]
line += 4
if letter == last_letter:
break
endpython
%s/\*//g
endfunction
" Python function for Spanish tests
function! SpanishTest()
python << endpython
import vim
buf = vim.current.buffer
buf[:20] = ["%s) " % i for i in xrange(1, 21)]
endpython
endfunction
" Setting highlight for enabled/disabled files
au BufNewFile,BufRead *.enabled set filetype=sh expandtab
au BufNewFile,BufRead *.disabled set filetype=sh expandtab
" Enabling hive mode
au BufNewFile,BufRead *.hql set filetype=hive expandtab
au BufNewFile,BufRead *.q set filetype=hive expandtab
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment