Skip to content

Instantly share code, notes, and snippets.

@roblogic
Last active March 20, 2018 04:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save roblogic/283bdb4adb90c9592520ba72615dd000 to your computer and use it in GitHub Desktop.
Save roblogic/283bdb4adb90c9592520ba72615dd000 to your computer and use it in GitHub Desktop.
My `vimrc` used with gVim on Windows. Resides in `C:\Program Files\Vim\`
set nocompatible
behave mswin
" Appearance
"
set synmaxcol=999 "turn off syntax when line is too long
colorscheme wombat
highlight Cursor guibg=lightgreen guifg=black
set guifont=Fira\ Mono\ Medium:h10
"set guifont=InputMonoCompressed:h10
"set guifont=Consolas:h11
set printfont=Consolas:h8
set columns=140
set lines=35
set printoptions=formfeed:y " Set page breaks for printing. <Ctrl-Q, Ctrl-L> in Windows
"let g:ale_set_highlights = 0 " Stop shellcheck and other linters
"let g:ale_lint_on_save = 0
let g:ale_lint_on_text_changed = 'never'
let g:ale_lint_on_enter = 0
" syntax for .plb files
syntax on
filetype on
au BufNewFile,BufRead *.plb set filetype=sql
" Behaviour
"
set backspace=indent,eol,start " allow backspacing over everything in insert mode
set nobackup " don't spray backup files everywhere
set dir=c:\\temp " use temp directory instead
set backupdir=c:\\temp
set history=500 " keep 500 lines of command line history
set ruler " show the cursor position all the time
set showcmd " display incomplete commands
"--search--
set incsearch " do incremental searching
set hlsearch
set ignorecase " ignore case
set smartcase " but don't ignore it, when search string contains uppercase letters
"--indent--
set cindent
set autoindent
set smartindent
set shiftwidth=4 " 4 characters for indenting
set tabstop=8 " to match notepad.exe
set smarttab
set expandtab
"--wrapping--
set breakindent " wrap long lines with indentation
set showbreak=»»
set nowrap " don't wrap by default
set tw=0 " don't jump to newline after col 80
set display+=lastline " Display partial last lines on teh screen instead of hiding them
set cursorline " always highlight the current line
"set showtabline=2 " always show buffers
set mouse=a " use mouse in xterm to scroll
set scrolloff=5 " 5 lines before and after the current line when scrolling
set hid " allow switching buffers, which have unsaved changes
set showmatch " showmatch: Show the matching bracket for the last ')'?
set completeopt=menu,longest,preview
set confirm
"silent! helptags ALL
" smarter j & k navigation
nnoremap <expr> j v:count ? 'j' : 'gj'
nnoremap <expr> k v:count ? 'k' : 'gk'
" prompt to save new buffer, otherwise just save it.
if has("gui_running")
:map <silent> <C-S> :if expand("%") == ""<CR>:browse confirm w<CR>:else<CR>:confirm w<CR>:endif<CR>
endif
:imap <C-C> <ESC><C-S>
" for use with vim-airline
set laststatus=2
let g:airline_powerline_fonts=0
let g:airline_symbols = {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment