Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- """""""""""MISC"""""""""""
- "clear all existing autocmds
- autocmd!
- "makes sure all the features all available
- set nocompatible
- "required for vim-plug and :! to work
- set shell=cmd.exe
- set noshellslash
- set shellquote="\""
- "make the global variable if it doesn't exist
- if !exists('g:BG')
- let g:BG=&background
- endif
- "make vim store g:CAPS variables to ~/_viminfo
- set viminfo+=!
- """""""""PLUGINS""""""""""
- call plug#begin('~/vimfiles/plugged')
- Plug 'altercation/vim-colors-solarized'
- Plug 'tpope/vim-surround'
- Plug 'ervandew/supertab'
- Plug 'exvim/ex-aftercolors'
- Plug 'scrooloose/nerdtree'
- Plug 'tpope/vim-commentary'
- call plug#end()
- """""""""GENERAL""""""""""
- "font and theming
- set guifont=Consolas:h12
- colorscheme solarized
- let g:solarized_italic=0
- syntax enable
- set guioptions-=m
- set guioptions-=T
- set guioptions-=L
- set guioptions-=l
- set guioptions-=R
- set guioptions-=r
- set guioptions-=b
- set guioptions-=h
- set guioptions-=e
- set guicursor+=n-v-c:blinkon0 "stop cursor blinking
- "line wrapping
- set wrap
- set linebreak
- set nolist " list disables linebreak
- set textwidth=0
- set wrapmargin=0
- set formatoptions-=t
- "visuals
- set cursorline
- set number
- set relativenumber
- set ruler
- set showcmd
- "indentation settings
- set tabstop=4
- set softtabstop=4
- set expandtab
- set autoindent
- set smartindent
- "search is case sensitive if it has a upper case letter
- set ignorecase
- set smartcase
- "no errorbells
- set noerrorbells visualbell t_vb=
- autocmd GUIEnter * set visualbell t_vb=
- "language settings
- set langmenu=en_US
- let $LANG = 'en_US'
- set encoding=utf-8
- set fileformats=unix,dos
- "highlight matches when searching
- set incsearch
- set hlsearch
- "use system clipboard
- set clipboard=unnamed
- "update changes to file automatically
- set autoread
- "make backspace behave normally
- set backspace=indent,eol,start
- """""""""MAPPINGS""""""""""
- "sets space as the leader key
- let mapleader=" "
- "makes these keys easier to use
- noremap , :
- noremap : ;
- noremap ; ,
- "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>
- "make Y behave the same way as D and C
- nnoremap Y y$
- "new line with enter/shift-enter in normal mode
- nnoremap <S-Enter> O<Esc>j
- nnoremap <CR> o<Esc>k
- "don't show match highlights
- nnoremap <Leader>n :noh<cr>
- "make split equal
- nnoremap <Leader>eq <C-w>=
- "exceute current python file
- nnoremap <Leader>py :w<CR>:!python %<CR>
- "open vimrc in a tab
- nnoremap <Leader>vr :tabe $MYVIMRC<CR>
- "source vimrc
- nnoremap <Leader>so :so $MYVIMRC<CR>
- "show NERDTree
- nnoremap <Leader>t :NERDTree
- "vim-plug commands
- nnoremap <Leader>pi :PlugInstall<CR>
- nnoremap <Leader>pc :PlugClean<CR>
- nnoremap <Leader>pu :PlugUpdate<CR>
- "toggle theme background
- nnoremap <F12> :call ToggleBG()<CR>
- """""""""FUNCTIONS""""""""""
- "funtion to toggle between solarized dark/light
- function! ToggleBG()
- if &background == "dark"
- set background=light
- let g:BG="light"
- else
- set background=dark
- let g:BG="dark"
- endif
- colorscheme solarized
- endfunction
- """""""""AUTOCMD""""""""""
- "toggle relative numbers between modes
- augroup LineNumbers
- autocmd!
- autocmd InsertEnter * :set norelativenumber
- autocmd InsertLeave * :set relativenumber
- augroup END
- "source vimrc when it's saved
- augroup Source
- autocmd!
- autocmd! BufWritePost _vimrc source %
- augroup END
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement