Skip to content

Instantly share code, notes, and snippets.

@Thom2503
Last active November 16, 2021 08:43
Show Gist options
  • Save Thom2503/101e0aab6031073a7b74c137447a1dfe to your computer and use it in GitHub Desktop.
Save Thom2503/101e0aab6031073a7b74c137447a1dfe to your computer and use it in GitHub Desktop.
My vimrc without plugins except for colors/monokai.vim
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"
" Thom2503's vimrc
"
" forked from https://gist.github.com/simonista/8703722
" Added colorscheme, mouse compatabilities and more.
"
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Don't try to be vi compatible
set nocompatible
" Helps force plugins to load correctly when it is turned back on below
filetype off
" TODO: Load plugins here (pathogen or vundle)
" Turn on syntax highlighting
syntax on
" For plugins to load correctly
filetype plugin indent on
" leader key
let mapleader = " "
" Security
set modelines=0
" turn hybrid line numbers on
:set number relativenumber
:set nu rnu
" Show file stats
set ruler
" Blink cursor on error instead of beeping (grr)
" set visualbell
" Encoding
set encoding=utf-8
" Whitespace
set wrap
set textwidth=120
set formatoptions=tcqrn1
set tabstop=2
set shiftwidth=2
set softtabstop=2
set expandtab
set noshiftround
" Cursor motion
set scrolloff=3
set backspace=indent,eol,start
set matchpairs+=<:>
set matchpairs+=(:)
set matchpairs+={:}" use % to jump between pairs
runtime! macros/matchit.vim
" Move up/down editor lines
nnoremap j gj
nnoremap k gk
" Allow hidden buffers
set hidden
" Rendering
set ttyfast
" Status bar
set laststatus=2
" Last line
set showmode
set showcmd
" Searching
nnoremap / /\v
vnoremap / /\v
set hlsearch
set incsearch
set ignorecase
set smartcase
set showmatch
map <leader><space> :let @/=''<cr> " clear search
" Remap help key.
inoremap <F1> <ESC>:set invfullscreen<CR>a
nnoremap <F1> :set invfullscreen<CR>
vnoremap <F1> :set invfullscreen<CR>
" Textmate holdouts
" Formatting
map <leader>q gqip
" Visualize tabs and newlines
set list listchars=tab:▸\ ,trail:·,precedes:←,extends:→,eol:↲,nbsp:␣,space:·
" Uncomment this to enable by default:
" set list " To enable by default
" Or use your leader key + l to toggle on/off
map <leader>l :set list!<CR> " Toggle tabs and EOL
" Color scheme (terminal)
set t_Co=256
set background=dark
colorscheme monokai
set mouse=a
" disabling highlights
nmap <leader>h :nohl<CR>
set noendofline binary
hi SpecialKey ctermfg=66 guifg=#aeb2b2
function! InsertTabWrapper()
let col = col('.') - 1
if !col || getline('.')[col - 1] !~ '\k'
return "\<tab>"
else
return "\<c-p>"
endif
endfunction
inoremap <tab> <c-r>=InsertTabWrapper()<cr>
" To go to a specific tab
nnoremap <leader>1 1gt
nnoremap <leader>2 2gt
nnoremap <leader>3 3gt
nnoremap <leader>4 4gt
nnoremap <leader>5 5gt
nnoremap <leader>6 6gt
nnoremap <leader>7 7gt
nnoremap <leader>8 8gt
nnoremap <leader>9 9gt
nnoremap <leader>0 0gt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment