Skip to content

Instantly share code, notes, and snippets.

@Htbaa
Last active February 13, 2025 13:05
Show Gist options
  • Save Htbaa/638267 to your computer and use it in GitHub Desktop.
Save Htbaa/638267 to your computer and use it in GitHub Desktop.
.gvimrc
" NOTE: a separate .vimrc is required for vim-plug: https://gist.github.com/Htbaa/b3c8d46db8936ad69c4c9bf46e55b51b
" Many thanks to https://raw.github.com/nvie/vimrc/master/vimrc
" http://nvie.com/posts/how-i-boosted-my-vim/
"set guifont="Droid Sans Mono:h10:b:cANSI"
"set guifont=Consolas:h10:b:cANSI
set number " always show line numbers
set smartindent
set hlsearch " highlight search terms
set tabstop=4 " a tab is four spaces
set shiftwidth=4 " number of spaces to use for autoindenting
set expandtab " expand tabs by default
set shiftround " use multiple of shiftwidth when indenting with '<' and '>'
set autoindent " always set autoindenting on
set copyindent " copy the previous indentation on autoindenting
set smartcase " ignore case if search pattern is all lowercase,
" case-sensitive otherwise
"set smarttab " insert tabs on the start of a line according to
" shiftwidth, not tabstop
set showmatch " set show matching parenthesis
set ignorecase " ignore case when searching
set cc=80 " display vertical bar at column 80
set ruler " always display editor column and line numbers
set showmode " always show what mode we're currently editing in
set backspace=indent,eol,start " allow backspacing over everything in insert mode
set hidden " hide buffers instead of closing them this
" means that the current buffer can be put
" to background without being written; and
" that marks and undo history are preserved
set history=1000 " remember more commands and search history
set undolevels=1000 " use many muchos levels of undo
set nobackup " do not keep backup files, it's 70's style cluttering
set cursorline " underline the current line, for quick orientation
set nocursorcolumn " hide vertical line
set scrolloff=5 " keep 5 lines of context above and below the cursor when scrolling
set directory=~/.vim/.tmp,~/tmp,/tmp,~/vim_temp " store swap files in one of these directories
set spell " enable spell checking
set spelllang=en_us,nl " dual language spellcheck
set laststatus=2 " Always show the statusline
set encoding=utf-8 " Necessary to show Unicode glyphs
set listchars=tab:▸\ ,trail:•,extends:»,precedes:«,eol:¬ " Nicer 'hidden' characters
set list
"set invlist
set nofixendofline " Do not 'fix' end of file line ending
colorscheme solarized
set bg=dark
inoremap <S-Tab> <C-O><LT><LT>
nnoremap <Tab> >>
nnoremap <S-Tab> <LT><LT>
vnoremap <Tab> >
vnoremap <S-Tab> <LT>
" Don't jump to next line in a wrapped line when pressing j/k
nnoremap j gj
"nnoremap <down> gj
nnoremap k gk
"nnoremap <up> gk
"Use the damn hjkl keys
"map <up> <nop>
"map <down> <nop>
"map <left> <nop>
"map <right> <nop>
" unlight search selection when pressing enter
:nnoremap <CR> :nohlsearch<cr>
" Store the bookmarks file
let NERDTreeBookmarksFile=expand("$HOME/.vim-NERDTreeBookmarks")
" Show the bookmarks table on startup
let NERDTreeShowBookmarks=1
"let g:NERDTreeWinPos = "right"
set guioptions-=T " Removes top toolbar
set guioptions-=r " Remove right hand scroll bar
set go-=L " Removes left hand scroll bar
" \\ toggles NERDTree
map \\ :NERDTreeToggle<CR>
autocmd BufRead,BufNewFile *.pl,*.plx,*.pm,*.t,*.psgi command! -range=% -nargs=* Tidy <line1>,<line2>!perltidy -q
autocmd BufRead,BufNewFile *.pl,*.plx,*.pm,*.t,*.psgi noremap <C-F6> :Tidy<CR>
" auto change current dir to open file - the alternative is set autochdir
" but autochdir can sometimes cause issues with plugins
autocmd BufEnter * silent! lcd %:p:h
"nmap <F9> :SCCompile<cr>
"nmap <F10> :SCCompileRun<cr>
syntax on
filetype on
filetype plugin on
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment