Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- "Colors to get:
- "Vydark: http://www.vim.org/scripts/script.php?script_id=3309
- "{{{ Custom Paths
- let $dropbox="E:\\Dropbox"
- let $unilua="$dropbox\\TAS Stuff\\Uniracers\\Scripts"
- let $vimwiki="~\\vimwiki"
- "}}}
- "{{{ Auto Commands
- " Automatically cd inot the directory that the file is in
- autocmd BufEnter * execute "chdir ".escape(expand("%:p:h"), ' ')
- " Remove any trailing whitespace that is in the file
- autocmd BufRead,BufWrite * if ! &bin | silent! %s/\s\+$//ge | endif
- " Restore cursor position to where it was before
- augroup JumpCursorOnEdit
- au!
- autocmd BufReadPost *
- \ if expand("<afile>:p:h") !=? $TEMP |
- \ if line("'\"") > 1 && line("'\"") <= line("$") |
- \ let JumpCursorOnEdit_foo = line("'\"") |
- \ let b:doopenfold = 1 |
- \ if (foldlevel(JumpCursorOnEdit_foo) > foldlevel(JumpCursorOnEdit_foo - 1)) |
- \ let JumpCursorOnEdit_foo = JumpCursorOnEdit_foo - 1 |
- \ let b:doopenfold = 2 |
- \ endif |
- \ exe JumpCursorOnEdit_foo |
- \ endif |
- \ endif
- " Need to postpone using "zv" until after reading the modelines.
- autocmd BufWinEnter *
- \ if exists("b:doopenfold") |
- \ exe "normal zv" |
- \ if(b:doopenfold > 1) |
- \ exe "+".1 |
- \ endif |
- \ unlet b:doopenfold |
- \ endif
- augroup END
- " Set word wrap for text files
- au BufRead,BufNewFile *.txt,*.tex,*.wiki set wrap linebreak nolist textwidth=0 wrapmargin=0
- "}}}
- "{{{ Plugin Management
- " Necessary for lots of cool Vim things
- set nocompatible
- " Vundle config
- filetype off
- " set the runtime path to include Vundle and initialize
- set rtp+=~/vimfiles/bundle/Vundle.vim/
- let path='~/vimfiles/bundle'
- call vundle#begin(path)
- " alternatively, pass a path where Vundle should install plugins
- "call vundle#begin('~/some/path/here')
- " let Vundle manage Vundle, required
- Plugin 'gmarik/Vundle.vim'
- " Goto vimawesome.com to find the entries to put here
- Plugin 'yaroot/vissort'
- Plugin 'vimwiki'
- Plugin 'bling/vim-airline'
- Plugin 'scrooloose/nerdtree'
- Plugin 'taglist.vim'
- Plugin 'xolox/vim-session'
- Plugin 'xolox/vim-misc'
- Plugin 'scrooloose/syntastic'
- Plugin 'Townk/vim-autoclose'
- Plugin 'thinca/vim-singleton'
- " use :PluginInstall to update plugins
- " All of your Plugins must be added before the following line
- call vundle#end() " required
- filetype plugin indent on " required
- " To ignore plugin indent changes, instead use:
- "filetype plugin on
- "
- " 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
- "}}}
- "{{{ Misc Settings
- " This shows what you are typing as a command.
- set showcmd
- " Folding Stuffs
- set foldmethod=marker
- " Needed for Syntax Highlighting and stuff
- filetype on
- filetype plugin on
- filetype plugin indent on
- syntax enable
- syntax on
- set grepprg=grep\ -nH\ $*
- " Who doesn't like autoindent?
- set autoindent
- " Spaces are better than a tab character
- set expandtab
- set smarttab
- " 4-character tab
- set shiftwidth=4
- set softtabstop=4
- set tabstop=4
- " Use english for spellchecking, but don't spellcheck by default
- if version >= 700
- set spl=en spell
- set nospell
- endif
- " Cool tab completion stuff
- set wildmenu
- set wildmode=list:longest,full
- set wildignore=*.swp,*.bak
- " Enable mouse support in console
- set mouse=a
- " Make Backspace and Delete work like I expect them to
- set backspace=2
- " Line numbers
- set number
- " Make searching ignore case, unless I put an uppercase character in the search
- set ignorecase
- set smartcase
- " Incremental search
- set incsearch
- " Highlight search terms
- set hlsearch
- " This allows buffers to be hidden if you've modified a buffer.
- set hidden
- " Set off the other paren
- highlight MatchParen ctermbg=4
- " Enable virtual space
- set virtualedit=all
- " Set no wrapping
- set nowrap
- " make sure the statusline shows
- set laststatus=2
- " get rid of the default mode indicator
- set noshowmode
- " no backup files
- set nobackup
- set noswapfile
- " Enable the list of buffers
- let g:airline#extensions#tabline#enabled = 1
- " Show just the filename
- let g:airline#extensions#tabline#fnamemod = ':t'
- let g:session_autosave='yes'
- let g:session_autoload='yes'
- call singleton#enable()
- "}}}
- "{{{ Look and Feel
- " Favorite Color Scheme
- colo vydark
- " other good themes: breeze, darkeclipse, dusk, lucius, oceanblack,
- " paintbox, rainbow_neon, rootwater, slate2, sorcerer, watermark, wuye,
- " xoria256
- " Highlight the current line
- set cursorline
- " GUI options
- if has("gui_running")
- set encoding=utf-8
- " Set font to Consolas
- " Download the Consolas for Powerline patch here: https://github.com/nicolalamacchia/powerline-consolas
- set guifont=Consolas:h10:cANSI
- " Powerline font configuration
- let g:airline_powerline_fonts = 1
- " Remove toolbar and menu
- set go-=T
- set go-=m
- " Add horizontal scroll bar
- set go+=b
- " set startup size
- set lines=50 columns=250
- endif
- "}}}
- "{{{ Mappings
- " \ev - Edit vimrc
- nnoremap <silent> <Leader>ev :tabnew<CR>:e ~/_vimrc<CR>
- " Space will toggle folds!
- nnoremap <space> za
- " Next Tab
- nnoremap <silent> <C-Right> :tabnext<CR>
- " Previous Tab
- nnoremap <silent> <C-Left> :tabprevious<CR>
- " New Tab
- nnoremap <silent> <C-t> :tabnew<CR>
- " Bind autocompletion to Ctrl+Space
- imap <c-space> <c-n>
- " Use jj to exit insert mode
- imap jj <esc>
- " Mappings to move lines up and down
- nnoremap <A-j> :m .+1<CR>==
- nnoremap <A-k> :m .-2<CR>==
- inoremap <A-j> <Esc>:m .+1<CR>==gi
- inoremap <A-k> <Esc>:m .-2<CR>==gi
- vnoremap <A-j> :m '>+1<CR>gv=gv
- vnoremap <A-k> :m '<-2<CR>gv=gv
- " Open dialog
- nnoremap <C-o> :tabnew<CR>:browse confirm e<CR>
- " Save dialog
- nnoremap <C-s> :browse confirm w<CR>
- " move vertically by visual line
- nnoremap j gj
- nnoremap k gk
- " copy, cut and paste shortcuts
- nnoremap <A-c> "+y
- nnoremap <A-x> "+x
- nnoremap <A-v> "+gP
- " Open a new buffer
- nnoremap <leader>bn :enew<cr>
- " close the current buffer and move to the previous one
- nnoremap <leader>bq :bp <bar> bd #<cr>
- " show all open buffers and their status
- nnoremap <leader>bl :ls<cr>
- " movement between buffers
- nnoremap <right> :bnext<cr>
- nnoremap <left> :bprevious<cr>
- nnoremap <up> :tabnext<cr>
- nnoremap <down> :tabprevious<cr>
- " plugin command mapping
- nnoremap <leader>pi :PluginInstall<cr>
- nnoremap <leader>nt :NERDTree<cr>
- " save some shift presses
- nnoremap ; :
- "This unsets the "last search pattern" register by hitting return
- nnoremap <CR> :noh<CR><CR>
- "Ctrl-Backspace to delete a word in insert mode
- inoremap <C-Backspace> <Esc>ldbi
- "}}}
- "{{{ Custom Commands
- command Pushvimrc call system("copy " . expand("$homepath\\_vimrc") . " " . expand(expand("$dropbox\\_vimrc")))
- command Pullvimrc call system("copy " . expand(expand("$dropbox\\_vimrc")) . " " . expand("$homepath\\_vimrc"))
- command Wiki :e $vimwiki\index.wiki
- "}}}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement