Skip to content

Instantly share code, notes, and snippets.

@lkurylo
Last active October 19, 2018 21:23
Show Gist options
  • Save lkurylo/aa947a1ae6d7185aa064 to your computer and use it in GitHub Desktop.
Save lkurylo/aa947a1ae6d7185aa064 to your computer and use it in GitHub Desktop.
"disable compatibility mode with Vi
set nocompatible
filetype off
set rtp+=~/vimfiles/bundle/Vundle.vim
call vundle#begin('~/vimfiles/bundle')
"Plugin 'VundleVim/Vundle.vim'
Plugin 'bling/vim-airline'
Plugin 'junegunn/seoul256.vim'
"Plugin 'kchmck/vim-coffee-script'
"Plugin 'hail2u/vim-css3-syntax'
"Plugin 'cakebaker/scss-syntax.vim'
"Plugin 'othree/javascript-libraries-syntax.vim'
"Plugin 'xolox/vim-session'
"Plugin 'mklabs/vim-backbone'
"Plugin 'tpope/vim-rails'
"Plugin 'tpope/vim-fugitive'
"Plugin 'chrisbra/Colorizer'
"Plugin 'xolox/vim-misc'
call vundle#end()
filetype plugin indent on
""disable beeping and windows flashing
"set noerrorbells visualbell t_vb=
"autocmd GUIEnter * set visualbell t_vb=
"
"colorscheme seoul256
"
"set relativenumber
"set number
"set numberwidth=5
""set tw=79
"set so=7 "when scrolling vertically, always 7 lines are visible
""set nowrap
""set fo-=t
"set backspace=indent,eol,start
"set spell "spellang=en_US
"
"set wrap
"set linebreak
"set nolist
"
"set wildmenu
"
""tab and spaces
"set tabstop=4
"set softtabstop=4
"set shiftwidth=4
"set shiftround
""set expandtab
"
"set colorcolumn=80
"highlight ColorColumn ctermbg=223
"
""hightlight the background for text that goes over the 80 column limit
""http://stackoverflow.com/a/10993757/453396
"augroup highlightTooLongText
" autocmd!
" autocmd BufEnter * highlight OverLength ctermbg=red guibg=#592929
" autocmd BufEnter * match OverLength /\%81v.*/
"augroup END
"
"augroup formatCode
" autocmd!
" autocmd BufWritePre,BufRead *.html,*.js,*.css :normal gg=G
"augroup END
"
"automatic reloading of vimrc
augroup reloadConfigFile
autocmd!
autocmd BufWritePost vimrc source %
augroup END
"
""undo/redo
"set history=1000
"set undolevels=1000
"
""search
"set hlsearch
"set incsearch
"set ignorecase
"set smartcase
"
"
if has('win32') && !has('gui_running') && !empty($CONEMUBUILD)
set termencoding=utf8
set term=xterm
set t_Co=256
let &t_AB="\e[48;5;%dm"
let &t_AF="\e[38;5;%dm"
endif
"
"set encoding
"explanation: http://stackoverflow.com/a/5795441/453396
if has("multi_byte")
" if &termencoding == ""
" let &termencoding = &encoding
" endif
set encoding=utf-8 " better default than latin1
setglobal fileencoding=utf-8 " change default file encoding when writing new files
endif
"
"
"
set laststatus=2
"
"let mapleader = ","
"let g:mapleader = ","
"
""remap the Esc key
"inoremap jk <Esc>
"vnoremap jk <Esc>
"nnoremap jk <Esc>
"inoremap <esc> <nop>
"nnoremap <esc> <nop>
"inoremap <C-c> <nop>
"nnoremap <C-c> <nop>
"
""better movement on wrapped lines
"noremap j gj
"noremap k gk
"
""windows
"nnoremap <C-j> <C-w>j
"nnoremap <C-k> <C-w>k
"nnoremap <C-h> <C-w>h
"nnoremap <C-l> <C-w>l
"nnoremap <C-c> <C-w>c
"
""insert new line and stay in normal mode
"nnoremap <CR> o<Esc>k
"
""restore Enter default action in command-line window
"augroup cmdLineWindows
"autocmd!
"autocmd CmdWinEnter * nnoremap <buffer> <CR> <CR>
""autocmd CmdWinEnter * AirlineRefresh
"augroup END
"
""disable cursors to train hjkl
"map <Left> <Nop>
"map <Right> <Nop>
"map <Up> <Nop>
"map <Down> <Nop>
"
""disable Ex mode
"map Q <nop>
"
""folds
"set foldcolumn=4
"
""tabs
"nnoremap <Leader>h :call NextTabOrBuffer()<CR>
"nnoremap <Leader>l :call PreviousTabOrBuffer()<CR>
"
"function! NextTabOrBuffer()
"if exists('*tabpagenr') && tabpagenr('$') != 1
" normal gt
"else
" execute ":bnext"
"endif
"endfunction
"
"function! PreviousTabOrBuffer()
"if exists('*tabpagenr') && tabpagenr('$') != 1
" normal gT
"else
" execute ":bprev"
"endif
"endfunction
"
"set showtabline=2
"
"set pastetoggle=<F5>
"set clipboard=unnamed
"
syntax on
let g:Powerline_symbols="fancy"
"
let g:airline_theme = "luna"
let g:airline_powerline_fonts = 1
"
let g:airline_enable_syntatic = 1
"
""set cursorline
"
"disable mouse
set mouse=
"
""map standard commands for easier use
"map <silent><F2> :NERDTreeMirror<CR>
"map <silent><F3> :NERDTreeFocus<CR>
"map <silent><F4> :NERDTreeToggle<CR>
"
""custom settings
"let g:NERDTreeBookmarksFile = "~\Vim\NERDTreeBookmarks"
"let g:NERDTreeWinSize = 40
"let g:NERDTreeWinPos = "right"
"let g:NERDTreeMinimalUI = 0
"
""close tree automatically with last window
"augroup nerdTreeAutoClose
" autocmd!
" autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTreeType") && b:NERDTreeType == "primary") | q | endif
"augroup END
"
""Colorizer plugin - https://github.com/chrisbra/Colorizer
"let g:colorizer_colornames = 0
"let g:colorizer_auto_filetype='css,html,js,vim'
"
"highlight ShowMarksHLl ctermfg=150 ctermbg=150
"highlight ShowMarksHLu ctermfg=150 ctermbg=150
"highlight ShowMarksHLo ctermfg=150 ctermbg=150
"highlight ShowMarksHLm ctermfg=150 ctermbg=150
"
""vim-session plugin - https://github.com/xolox/vim-session
"let g:session_autoload = 'yes'
"let g:sesssion_default_overwrite = 1
"let g:session_autosave = 'yes'
"let g:session_autosave_periodic = 5
"let g:session_default_to_last = 1
"let g:session_command_aliases = 1
"
""disable arrows keys
"map <Esc>Oa <Nop>
"map <Esc>Ob <Nop>
"map <Esc>[1;2a <Nop>
"map <Esc>[1;2b <Nop>
"map! <Esc>Oa <Nop>
"map! <Esc>Ob <Nop>
"map! <Esc>[1;2a <Nop>
"map! <Esc>[1;2b <Nop>
"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment