Skip to content

Instantly share code, notes, and snippets.

@OpnSrcConstruction
Created May 19, 2021 20:07
Show Gist options
  • Select an option

  • Save OpnSrcConstruction/a7bd32c7c87ad4778a226579732e19d0 to your computer and use it in GitHub Desktop.

Select an option

Save OpnSrcConstruction/a7bd32c7c87ad4778a226579732e19d0 to your computer and use it in GitHub Desktop.

Revisions

  1. OpnSrcConstruction created this gist May 19, 2021.
    473 changes: 473 additions & 0 deletions .vimrc
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,473 @@
    "" created from scratch on Friday, July 27 2018 @ 09:04:56 PM by kjlw99
    "" Zim. I wanted a completely from scratch .vimrc, so I knew which options
    "" from none to all were set to what I wanted. And all of this before I
    "" ever added any plugins.

    "#########################
    "# Vim-settings section: #
    "#########################

    set t_Co=256 " enable 256color support
    scriptencoding utf-8
    set encoding=utf-8

    set cursorline " Highlights current-line.
    set cursorcolumn " Highlights current vertical column.
    set number " Set first for a reason. ;D
    set relativenumber " Screw couting to G anywhere.
    set wildmenu " Set for cool File opening.
    set nocompatible " Set, so vim won't be held back by vi.
    set ruler " Enable cursor position coordinates, in Bottom-right corner.
    set syntax=on " enable color syntax.
    " set syntax=enable " Enable syntax highlights.
    set history=10000 " Keep 10,000 undo.
    set expandtab " Insert spaces instead of tabs.
    set shiftwidth=2 " Indent with two spaces.
    set softtabstop=2 " ... and insert two spaces.
    set incsearch " Increamental search, find as you type word.
    set hlsearch " Highlight search results.
    set hidden " Hide the buffer, instead of closing when switching.
    set ignorecase " Search insensitive.
    set smartcase " ... but smart.
    set autoindent " Copy the indent of the current line, into a new line.
    set smartindent " Smart... indent.
    set shortmess+=I " No intro when starting Vim.
    " set ttyfast " Faster redraw, with xterm.
    " set mouse=nv " Mouse activated in Normal and Visual Mode.
    set mouse=a " enable mouse support and activate visual mode with dragging.
    set showmatch " When a bracket is inserted, briefly jump to the matching one.
    set matchtime=3 " ... during this time.
    set list " Inserts special characters.
    " set updatetime=1000 " ???
    nnoremap <space> <Nop> " Set so space/leader mapping presses are faster.
    let mapleader=' ' " Set leader to Space-bar.
    filetype plugin on " Set for VimWiki support.
    set nopaste " Set paste to off.

    " NetRW_hax:

    " These next 2 lines will hide the dot files on startup
    let ghregex='\(^\|\s\s\)\zs\.\S\+'
    let g:netrw_list_hide=ghregex

    "#Turn off the banner at the top of the sreen on startup
    let g:netrw_banner=0

    " Turn on opening netRW document in Previous main tab.
    let g:netrw_browse_splt = 4

    "# to change the way netrw shows the files and directorys
    "let g:netrw_liststyle= 0 " Default view (directory name/file name)
    "let g:netrw_liststyle= 1 " Show time and size
    "let g:netrw_liststyle= 2 " Shows listing in 2 columns
    let g:netrw_liststyle= 3 " show the tree listing

    "###########################################################
    "# The line below will update: #
    "# The tab character to → unicode u2192 #
    "# The end of line character to ↲ unicode u21b2 #
    "###########################################################
    set listchars=tab:→\ ,eol:↲,trail:~,extends:>,precedes:<
    set lcs+=space:·

    " Set Lines that tell you, how many indents deep you are oon the IndentLine Plugin.
    let g:indentLine_char_list = ['|', '¦', '', '']

    autocmd BufWinLeave *.* mkview " Auto-save Folds before leaving a buffer.
    autocmd BufWinEnter *.* silent loadview " Auto-re-load saved folds.

    " reopen file where you left off at
    " http://stackoverflow.com/questions/774560
    " make sure to have permissions to ~/.viminfo if it doesnt work
    " sudo chown user:group ~/.viminfo
    " where user is your username and group is often the same as your username
    augroup line_return
    au!
    au BufReadPost *
    \ if line("'\"") > 0 && line("'\"") <= line("$") |
    \ execute 'normal! g`"zvzz' |
    \ endif
    augroup END

    "#########################
    "# Vim-mappings section: #
    "#########################

    "############################
    "# leader-mappings section: #
    "############################

    nnoremap <leader>tp :togglepaste<CR>
    "########################################################################
    "# NOrmal NOn-REcursive MAPing that will Split the window vertically, #
    "# launch the netrw file-manager, and resize that window to 20 columns. #
    "########################################################################
    nnoremap <leader>ve :Vexplore <CR> <bar> :vertical resize 20 <CR>
    " Toggle the IndentLine vertical alignment Plug-in.
    nnoremap <leader>it :IndentLinesToggle<CR>
    "################################################################
    "# Toggle highlight searching. #
    "# Map nh to toggle off the search highlighting in Normal mode. #
    "################################################################
    nnoremap <leader>nh :nohl<CR>
    "##################################################################
    "# Map nr to toggle off the relative line numbers in Normal mode. #
    "##################################################################
    nnoremap <leader>nr :set nornu<CR>
    "#########################################################
    "# Map n, to toggle regular line-numberings on, #
    "# to check for which specific line of the file your on. #
    "#########################################################
    nnoremap <leader>nn :set nonu<CR>
    "##########################################################################
    "#I'm mapping comma{,} + lower-case 'l' to disable special char listings. #
    "##########################################################################
    nnoremap <leader>nl :set nolist<CR>
    "##########################
    "# Color-scheme-mappings: #
    "##########################

    nnoremap <leader>bw :colo badwolf<CR>
    "##############################################################################
    "# cm == copy-mode. disables special characters($) and relative-line-numbers. #
    "##############################################################################
    nnoremap <leader>cm :set nolist <CR> <bar> :set nornu <CR> <bar> :set nonu <CR> <bar> :set paste <CR>
    "########################################################################
    "# Adding some hotkeys to more easily deal with splits. #
    "# qq == :q aka quit file. You will be prompted if the file is unsaved. #
    "# wq == :wq aka Save and quit. #
    "# qa == :qa! aka quit the file without saving #
    "# w == :w <ENTER> aka save(write) file. #
    "########################################################################
    nnoremap <leader>wq :wq<CR>
    nnoremap <leader>qq :q<CR>
    nnoremap <leader>qa :qa!<CR>
    nnoremap <leader>s :w<CR>
    "#################################################
    "# I'm mapping vc to reload the .vimrc, #
    "# without closing and re-opening he vim config. #
    "#################################################
    noremap <leader>vc :source ~/.vimrc<CR>
    "#############################################################
    "# Spell check set to sc(Spell-Check)/es(Switch 2 ESpañol.). #
    "#############################################################
    map <leader>sc :setlocal spell! spelllang=en_us<CR>
    map <leader>es :set spelllang=es<CR>
    "########################################################################
    "# hotkey mappings for jumps, marks, buffer-LiSting, and changes menus. #
    "########################################################################
    nnoremap <leader>mm :marks<CR>
    nnoremap <leader>jj :jumps<CR>
    nnoremap <leader>ll :ls<CR>
    nnoremap <leader>cc :changes<CR>
    "###############################
    "# Other General key-mappings. #
    "###############################
    nnoremap <leader>dm :delmarks! " Delete ALL marks:
    " TABS:
    nnoremap <leader>tt :tabnew<CR> " New-tab
    nnoremap <leader>nt :terminal<CR> " New-terminal
    nnoremap <leader>bt gT " Backward-tab(s)
    nnoremap <leader>ft gt " Forward-tab(s)
    nnoremap <leader>tc :tabclose<CR> " Close-tab
    nnoremap <leader>db :bd<CR> " Delete-Buffer
    "#################################
    "# Insert-mode mappings section: #
    "#################################

    "###############################################################################
    "# Insert mode non-recursive maps to Auto-add both encapsulations([{<'""'>}]), #
    "# and put myself inside of them in insert mode. #
    "###############################################################################
    inoremap { {}<esc>i
    inoremap [ []<esc>i
    inoremap ( ()<esc>i
    inoremap < <><esc>i
    inoremap ' ''<esc>i
    inoremap " ""<esc>i
    "#################################
    "# Control-key mappings section: #
    "#################################

    "#########################################
    "# Yank to system buffer in visual mode. #
    "#########################################
    vnoremap <C-c> "+y
    "##############################################
    "# Paste from system buffer Into insert mode. #
    "##############################################
    map <C-p> "+P
    "##################################################################
    "# Set ctrl + n(next)|p(previous) to switch between open buffers. #
    "# Added from filmsbykris video 10 of vim #
    "##################################################################
    nnoremap <C-n> :bnext<CR>
    nnoremap <C-p> :bprevious<CR>
    "#############################
    "# special-mappings section: #
    "#############################

    "############################################################
    "# Re-assign arrow keys to No Operation (insert mode too) #
    "# Added Wednesday, November 20 @ 6:34PM by kjlw99 aka Zim. #
    "############################################################
    nnoremap <up> <nop>
    nnoremap <down> <nop>
    nnoremap <left> <nop>
    nnoremap <right> <nop>
    " Disabling arrow keys with inoremap doesn't work on Thinkpads, unless on KDE.
    "" inoremap <up> <nop>
    "" inoremap <down> <nop>
    "" inoremap <left> <nop>
    "" inoremap <right> <nop>

    "############################################################
    "# Re-assign h-j-k-l to No Operation. #
    "# Added Sunday, July 26 @ 3:10 PM by kjlw99 aka Zim. #
    "# Disabled, b/c it made netrw unable to navigate. #
    "############################################################
    "" nnoremap h <nop>
    "" nnoremap j <nop>
    "" nnoremap k <nop>
    "" nnoremap l <nop>

    "##############################################################################
    "# Copied w/o save from: #
    "# https://github.com/LukeSmithxyz/voidrice/blob/master/.config/nvim/init.vim #
    "# Save file as sudo on files that require root permission #
    "##############################################################################
    noremap w!! execute 'silent! write !sudo tee % >/dev/null' <bar> edit!
    "######################
    "# Plugin-(s)section: #
    "######################

    call plug#begin('~/.vim/plugged')

    "" Themes:
    Plug 'sjl/badwolf' " A good color scheme 4 Python/Markdown/HTML.
    Plug 'yggdroot/indentline' " A Plugin to easily visualize how code lines up vertically.

    "" Functional_plugins:
    Plug 'vimwiki/vimwiki'
    Plug 'pablopunk/persistent-undo.vim'

    call plug#end()

    "##########################
    "# Autocorrect Dictionary #
    "##########################
    iab ture true
    iab flase false
    iab kevin. kevin.j.lausen@gmail.com
    iab i I
    iab teh the
    iab acomodate accommodate
    iab acommodate accommodate
    iab accomodate accommodate
    iab acheive achieve
    iab aquire acquire
    iab acros across
    iab adres address
    iab addres address
    iab adress address
    iab advertize advertise
    iab aparent apparent
    iab argumant argument
    iab athete athlete
    iab aweful awful
    iab balkanse balance
    iab bandwith bandwidth
    iab basicly basically
    iab basicaly basically
    iab becomming becoming
    iab begining beginning
    iab beleive believe
    iab bennefit benefit
    iab briliant brilliant
    iab busines business
    iab calender calendar
    iab carefull careful
    iab catagory category
    iab cieling ceiling
    iab comming coming
    iab citicen citizen
    iab conveneince convenience
    iab competittion competition
    iab critisize criticize
    iab develope develop
    iab desprate desperate
    iab diference difference
    iab dilema dilemma
    iab disapear disappear
    iab dissapear disappear
    iab distrobution distribution
    iab disapoint disappoint
    iab dissapoint disappoint
    iab disipline discipline
    iab dos does
    iab duering during
    iab iether either
    iab embaras embarrass
    iab embarass embarrass
    iab embarras embarrass
    iab envirenment environment
    iab equiped equipped
    iab exagerate exaggerate
    iab excelent excellent
    iab exept except
    iab experiense experience
    iab facsinating fascinating
    iab finaly finally
    iab foriegn foreign
    iab fourty forty
    iab fundimental fundamental
    iab generaly generally
    iab govermint government
    iab goverment government
    iab gramar grammar
    iab garantee guarentee
    iab giedence guidence
    iab hapiness happiness
    iab horedously horrendously
    iab hero heroe
    iab humerous humorous
    iab imatation imitation
    iab immitation imitation
    iab imediately immediately
    iab incidentaly incidentally
    iab indipendent independent
    iab independiny independent
    iab intristing interesting
    iab interfer interfere
    iab interpratation interpretation
    iab interuption interruption
    iab irelevant irrelevant
    iab irrelivant irrelevant
    iab irrelevint irrelevant
    iab iland island
    iab jelous jealous
    iab jealus jealous
    iab judgement judgment
    iab laboritory laboratory
    iab lenth length
    iab leson lesson
    iab lisense license
    iab lonlines lonliness
    iab loseing losing
    iab lieing lying
    iab mariage marriage
    iab marage marriage
    iab mathimatics mathematics
    iab mathamatics mathematics
    iab medisine medicine
    iab miniture miniature
    iab minite minute
    iab mystyrious mysterious
    iab naturaly naturally
    iab necesary necessary
    iab nieghbor neighbor
    iab niether neither
    iab noticable noticeable
    iab ocasion occasion
    iab ocasional occasional
    iab ocured occurred
    iab occured occurred
    iab ocurred occurred
    iab oficial official
    iab oftan often
    iab oftin often
    iab omision omission
    iab oparate operate
    iab opirate operate
    iab optamism optimism
    iab paralel parallel
    iab particalary particulary
    iab percieve perceive
    iab perminant permanent
    iab permanint permanent
    iab perservere persevere
    iab persavere persevere
    iab persade persuade
    iab personel personnel
    iab peice piece
    iab planing planning
    iab plesant pleasant
    iab politicul political
    iab politacala political
    iab poses possess
    iab posses possess
    iab posess possess
    iab posible possible
    iab practacle practicle
    iab prafer prefer
    iab prifer prefer
    iab predjudice prejudice
    iab presince presence
    iab privalege privilege
    iab privledge privilage
    iab privlege privilege
    iab probly probably
    iab profesional professional
    iab promis promise
    iab psycology psychology
    iab quantaty quantity
    iab quartar quarter
    iab realise realize
    iab recieve receive
    iab recognise recognize
    iab recomend recommend
    iab recamend recommend
    iab recammend recommend
    iab refrence reference
    iab religus religious
    iab religius religious
    iab repatition repitition
    iab resturant restaurant
    iab rhythem rhythm
    iab rhythum rhythm
    iab rediculous ridiculous
    iab sacrafice sacrifice
    iab safty safety
    iab scisors scissors
    iab secratary secretary
    iab shinning shining
    iab simaler similar
    iab soldeir soldier
    iab speach speech
    iab stoping stopping
    iab suceed succeed
    iab sucessful successful
    iab sucesful successful
    iab succesful successful
    iab surly surely
    iab tempurature temperature
    iab temperary temporary
    iab thruogh through
    iab towrd toward
    iab treis tries
    iab truley truly
    iab twelvth twelfth
    iab usualy usually
    iab vilage village
    iab wierd weird
    iab welcom welcome
    iab kk K