Skip to content

Instantly share code, notes, and snippets.

@jeromescuggs
Created December 21, 2022 02:55
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 jeromescuggs/90c413024f7c8ccc1c8749095e5a6889 to your computer and use it in GitHub Desktop.
Save jeromescuggs/90c413024f7c8ccc1c8749095e5a6889 to your computer and use it in GitHub Desktop.
my vimrc
"# Basic Settings
set nocompatible " vim-specific settings, non-vi-compatible
set backspace=indent,eol,start " Allow backspace in insert mode
set number " Line numbers
set ai
set hidden " Allow hidden buffers
filetype plugin indent on " Enable file type detection and do language-dependent indenting.
set history=100 " Default = 8
nnoremap ; :
set tabstop=4 " Default tabs are too big
set sw=4
set wrap " Turn on word wrapping
set linebreak " Only wrap at sensible places
set nolist " list disables linebreak
set textwidth=0 " prevent Vim from automatically inserting line breaks
set wrapmargin=0
set formatoptions-=t " Don't change wrapping on existing lines
set formatoptions+=l
set nofoldenable
set et
set cc=80
set tags=~/.vim/tags
" no indent on paste, with F2 toggle
set pastetoggle=<F2>
nnoremap <F2> :set invpaste paste?<CR>
set mouse=a " allow using mouse
set laststatus=2 "Make airline status bar appear all the time
set cmdheight=1
if has('nvim')
call plug#begin('~/.vim/plugged') "NVIM-ONLY PLUGINS
" [ lsp config for neovim ]
Plug 'neovim/nvim-lspconfig'
" Plug 'williamboman/nvim-lsp-installer'
Plug 'kabouzeid/nvim-lspinstall'
else
call plug#begin('~/.vim/plugged') "VIM-ONLY PLUGINS
Plug 'scrooloose/nerdtree' "(any plugin that would break
Plug 'ryanoasis/vim-devicons' "if this vimrc is used in neovim)
Plug 'kuntau/ayu-vim'
endif
" UNIVERSAL PLUGINS BELOW
" [ colorize hex codes ]
Plug 'lilydjwg/colorizer'
" [ highlighting and vim config for markdown ]
Plug 'davidbeckingsale/writegood.vim'
Plug 'plasticboy/vim-markdown'
" Plug 'tpope/vim-markdown'
" Plug 'gabrielelana/vim-markdown'
" [ plugins for vim-as-text-editor ]
Plug 'vim-scripts/txt.vim'
Plug 'sheerun/vim-polyglot'
Plug 'tpope/vim-abolish' " Fancy abbreviation replacements
" Plug 'junegunn/limelight.vim' " Highlights only active paragraph
" Plug 'junegunn/goyo.vim' " Full screen writing mode
Plug 'reedes/vim-lexical' " Better spellcheck mappings
Plug 'vim-pandoc/vim-pandoc-syntax'
"Plug 'reedes/vim-litecorrect' " Better autocorrections
Plug 'reedes/vim-wordy'
" Plug 'reedes/vim-pencil'
Plug 'mhinz/vim-startify'
" [ commenting kakstyle ]
Plug 'scrooloose/nerdcommenter'
" [ misc goodies ]
"Plug 'justinmk/vim-syntax-extra'
Plug 'xolox/vim-misc'
Plug 'xolox/vim-notes'
Plug 'kristijanhusak/vim-carbon-now-sh'
" [ misc style goodies ]
" Plug 'vim-airline/vim-airline'
" Plug 'vim-airline/vim-airline-themes'
" Plug 'bling/vim-bufferline'
Plug 'vim-syntastic/syntastic'
"Plug 'edkolev/tmuxline.vim'
Plug 'fadein/vim-FIGlet'
" [ themes ]
Plug 'jacoborus/tender.vim'
Plug 'sainnhe/edge'
Plug 'joshdick/onedark.vim'
Plug 'srcery-colors/srcery-vim'
" pizzazz
Plug 'mhinz/vim-startify'
" Plug 'wfxr/minimap.vim'
Plug 'yuttie/comfortable-motion.vim'
call plug#end()
" enable spell/grammar checking when writing markdown
autocmd filetype markdown,md,page WritegoodEnable
" tuning for gVim only
" if has('gui_running')
" set number " show line numbers
" set columns=84 lines=48 " GUI window geometry
" set guifont=Monospace\ 12 " font for GUI window
" set background=light " light background for GUI
" endif
" theme options
" workaround to let termguicolors play nice with tmux
if exists('$TMUX')
let &t_8f = "\<Esc>[38;2;%lu;%lu;%lum"
let &t_8b = "\<Esc>[48;2;%lu;%lu;%lum"
set termguicolors
else
set termguicolors
endif
if has ('nvim')
" luafile /home/jerome/.config/nvim/lua/evil2.lua
endif
" if the comfortable-motion plugin is loaded, set up my defaults
if has_key(plugs, 'comfortable-motion.vim')
noremap <silent> <PageDown> :call comfortable_motion#flick(g:comfortable_motion_impulse_multiplier * winheight(0) * 2)<CR>
noremap <silent> <PageUp> :call comfortable_motion#flick(g:comfortable_motion_impulse_multiplier * winheight(0) * -2)<CR>
let g:comfortable_motion_no_default_key_mappings = 1
let g:comfortable_motion_impulse_multiplier = 1 " Feel free to increase/decrease this value.
let g:comfortable_motion_friction = 70.0
let g:comfortable_motion_air_drag = 1.5
nnoremap <silent> <ScrollWheelDown> :call comfortable_motion#flick(g:comfortable_motion_impulse_multiplier * winheight(0) * 1)<CR>
nnoremap <silent> <ScrollWheelUp> :call comfortable_motion#flick(g:comfortable_motion_impulse_multiplier * winheight(0) * -1)<CR>
nnoremap <silent> <C-f> :call comfortable_motion#flick(g:comfortable_motion_impulse_multiplier * winheight(0) * 2)<CR>
nnoremap <silent> <C-b> :call comfortable_motion#flick(g:comfortable_motion_impulse_multiplier * winheight(0) * -2)<CR>
endif
" ==============[ themes ]================
" set t_Co=256
set background=dark
" enable highlighting and map commands
syntax on
" file tree explorer setup
if has('nvim')
nnoremap <C-n> :NvimTreeToggle<CR>
nnoremap <leader>r :NvimTreeRefresh<CR>
nnoremap <leader>n :NvimTreeFindFile<CR>
else
nnoremap <C-n> :NERDTreeToggle<CR>
endif
" minimap only works with recent vim version
" if v:version >= 802
" let g:minimap_auto_start = 1
" endif
" commenting
let g:NERDSpaceDelims = 1
let g:NERDDefaultAlign = 'left'
let g:NERDToggleCheckAllLines = 1
nnoremap <F3> :call NERDComment('n','Toggle')<CR>
" nnoremap <F3> :call NERDComment('x','Toggle')<CR>
" filetype associations
au BufEnter,BufRead,BufNewFile *.page,*.md,*.archive setlocal filetype=markdown
" au BufEnter,BufRead,BufNewFile *.page :setlocal filetype=md
" :autocmd VimEnter * :AirlineRefresh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment