From bb532024521650cd6d0bedfb498589e6d901a583 Mon Sep 17 00:00:00 2001 From: moebiusband Date: Fri, 3 Feb 2023 13:39:11 +0100 Subject: [PATCH 1/3] Initial commit --- LICENSE | 11 +++++++++++ README.md | 3 +++ 2 files changed, 14 insertions(+) create mode 100644 LICENSE create mode 100644 README.md diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..ea890af --- /dev/null +++ b/LICENSE @@ -0,0 +1,11 @@ +Copyright (c) . + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..eb8b9c7 --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# dotfiles + +My dotfiles \ No newline at end of file From 720dc8d3508cc0c608ed411a8d31204875164b80 Mon Sep 17 00:00:00 2001 From: Jan Eitzinger Date: Fri, 3 Feb 2023 13:44:35 +0100 Subject: [PATCH 2/3] Add vim config --- .vimrc | 546 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 546 insertions(+) create mode 100644 .vimrc diff --git a/.vimrc b/.vimrc new file mode 100644 index 0000000..45ca7f4 --- /dev/null +++ b/.vimrc @@ -0,0 +1,546 @@ +" vim: fdm=marker ts=2 sts=2 sw=2 + +if has('python3') + silent! python3 1 +endif + +let mapleader = "\" +let maplocalleader = "\\" +map +let g:elite_mode=1 + +source ~/.vim/local.vim + +" Plugins {{{ +call plug#begin('~/.vim/plugged') +"########### +" Utility +"########### +Plug '~/.fzf' +Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' } "{{{ +let NERDTreeShowHidden=0 +let NERDTreeMinimalUI = 1 +let NERDTreeDirArrows = 1 +"}}} +Plug 'preservim/tagbar', { 'on': 'TagbarToggle' } "{{{ + +"}}} +Plug 'lifepillar/vim-mucomplete' "{{{ +let g:mucomplete#chains = { + \ 'default': ['c-p', 'omni'], + \ 'markdown': ['keyp', 'thes', 'spel', 'dict'], + \ 'tex': ['keyp', 'ulti', 'spel', 'thes', 'dict'] + \ } +inoremap MyCR mucomplete#ultisnips#expand_snippet("\") +imap MyCR +inoremap pumvisible() ? "\" : "\u\" +inoremap (MUcompleteFwdKey) +imap (MUcompleteCycFwd) +inoremap (MUcompleteBwdKey) +imap (MUcompleteCycBwd) +"}}} +"Plug 'sirver/ultisnips' "{{{ +"let g:UltiSnipsSnippetDirectories =[$HOME.'/.vim/plugged/vim-snippets/UltiSnips'] +"let g:UltiSnipsExpandTrigger = "" " Do not use +"let g:UltiSnipsListSnippets = "" " Do not use +"let g:UltiSnipsJumpForwardTrigger = "" " Do not use +""}}} +Plug 'junegunn/fzf.vim' "{{{ +let g:fzf_layout = { 'window': { 'width': 0.9, 'height': 0.6 } } +let g:fzf_preview_window = '' + +nnoremap e :Files +nnoremap E :History +nnoremap b :Buffer +nnoremap c :Commits +nnoremap s :Snippets +" nnoremap a :Ag +nnoremap g :Rg +nnoremap l :BLines +nnoremap L :Lines +nnoremap t :BTags +nnoremap T :Tags +nnoremap h :Helptags +"}}} +Plug 'junegunn/vim-easy-align' "{{{ +xmap gl (EasyAlign) +nmap gl (EasyAlign) +"}}} +Plug 'easymotion/vim-easymotion' "{{{ +let g:EasyMotion_do_mapping = 0 +let g:EasyMotion_smartcase = 1 +" map (easymotion-prefix) +nmap s (easymotion-overwin-f2) +map w (easymotion-bd-w) +nmap w (easymotion-overwin-w) +map j (easymotion-j) +map k (easymotion-k) +"}}} +Plug 'konfekt/fastfold' "{{{ +nmap zuz (FastFoldUpdate) +let g:fastfold_savehook = 1 +let g:tex_fold_enabled = 1 +let g:vimsyn_folding = 'af' +let g:javaScript_fold = 1 +let g:perl_fold = 0 +let g:php_folding = 0 +" }}} +Plug 'tpope/vim-unimpaired' "{{{ +"}}} +Plug 'mhinz/vim-grepper' "{{{ +nnoremap g :Grepper -tool rg +nnoremap G :Grepper -tool ag + +nmap gs (GrepperOperator) +xmap gs (GrepperOperator) + +let g:grepper = {} +let g:grepper.tools = ['rg', 'ag', 'git', 'ack'] +let g:grepper.jump = 1 +let g:grepper.next_tool = 'g' +let g:grepper.simple_prompt = 1 +let g:grepper.quickfix = 0 +"}}} +Plug 'tpope/vim-dispatch' +Plug 'tpope/vim-repeat' +Plug 'tpope/vim-surround' +Plug 'tpope/vim-eunuch' +Plug 'vasconcelloslf/vim-interestingwords' "{{{ +" nnoremap k :call InterestingWords('n') +" nnoremap K :call UncolorAllWords() +" nnoremap n :call WordNavigation('forward') +" nnoremap N :call WordNavigation('backward') +"}}} + +"############################# +" Generic Programming Support +"############################# +Plug 'honza/vim-snippets' +Plug 'jiangmiao/auto-pairs' "{{{ +let g:AutoPairsShortcutFastWrap='' +let g:AutoPairsMapSpace = 0 +imap pumvisible() + \ ? "" + \ : "=AutoPairsSpace()" +let g:AutoPairsMapCR = 0 +let g:AutoPairsMapSpace = 0 +imap pumvisible() + \ ? "" + \ : "=AutoPairsSpace()" + +inoremap UltiExpand + \ mucomplete#ultisnips#expand_snippet("\") +imap MyCR UltiExpandAutoPairsReturn +imap MyCR +"}}} +Plug 'ntpeters/vim-better-whitespace' "{{{ +let g:better_whitespace_filetypes_blacklist=['mail', 'diff', 'gitcommit', 'unite', 'qf', 'help'] +"}}} +Plug 'tpope/vim-commentary' +Plug 'cespare/vim-toml' +Plug 'AndrewRadev/splitjoin.vim' +Plug 'tobyS/vmustache' +Plug 'dense-analysis/ale' "{{{ +let g:ale_sign_error = '✘' +let g:ale_sign_warning = '⚠' +highlight ALEErrorSign ctermbg=NONE ctermfg=red +highlight ALEWarningSign ctermbg=NONE ctermfg=yellow +let g:ale_lint_on_save = 1 +let g:ale_fix_on_save = 1 +let g:ale_lint_on_enter = 0 +let g:ale_lint_on_text_changed = 'never' +set omnifunc=ale#completion#OmniFunc +let g:ale_linter_aliases = {'svelte': ['css', 'javascript']} +let g:ale_linters = { +\ 'javascript': ['standard'], +\ 'svelte': ['stylelint', 'eslint'], +\ 'go': ['go build', 'gometalinter'] +\ } +let g:ale_fixers = { +\ '*': ['remove_trailing_lines', 'trim_whitespace'], +\ 'javascript': ['prettier', 'eslint'], +\ 'svelte': ['eslint', 'prettier', 'prettier_standard'], +\ 'go': ['goimports'] +\ } +let g:gometalinter_fast = '' + \ . ' --enable=vet' + \ . ' --enable=errcheck' + \ . ' --enable=ineffassign' + \ . ' --enable=goimports' + \ . ' --enable=misspell' + \ . ' --enable=lll --line-length=120' +let g:ale_go_gometalinter_options = '--disable-all --tests' . g:gometalinter_fast . ' --enable=golint' +"}}} + +"##################### +" Markdown / Writing +"##################### +Plug 'dbmrq/vim-ditto' "{{{ +" au FileType markdown,text,tex DittoOn +nmap di ToggleDitto " Turn Ditto on and off +nmap =d DittoNext " Jump to the next word +nmap -d DittoPrev " Jump to the previous word +nmap +d DittoGood " Ignore the word under the cursor +nmap _d DittoBad " Stop ignoring the word under the cursor +nmap ]d DittoMore " Show the next matches +nmap [d DittoLess " Show the previous matches +"}}} +Plug 'kana/vim-textobj-user' +Plug 'reedes/vim-textobj-quote' +Plug 'reedes/vim-textobj-sentence' +Plug 'reedes/vim-wordy' "{{{ +" let g:wordy_spell_dir = '~/.vim/spell/wordy' +"}}} +Plug 'reedes/vim-lexical' "{{{ +let g:lexical#thesaurus = ['~/.vim/thesaurus/english.txt',] +let g:lexical#spellfile = ['~/.vim/spell/en.utf-8.add',] +let g:lexical#thesaurus_key = 't' +let g:lexical#dictionary_key = 'k' +"}}} +Plug 'reedes/vim-litecorrect' +Plug 'reedes/vim-pencil' "{{{ +let g:pencil#map#suspend_af = 'K' +"}}} +Plug 'tpope/vim-abolish' +Plug 'tpope/vim-markdown' +Plug 'iamcco/markdown-preview.nvim', { 'do': 'cd app && yarn install' } "{{{ +let g:mkdp_refresh_slow = 1 +"}}} +Plug 'lervag/vimtex' "{{{ +let g:tex_flavor = 'latex' +"}}} + +"##################### +" Productivity +"##################### +Plug 'fcpg/vim-waikiki' "{{{ +let g:waikiki_roots = ['~/doc/vimwiki/'] +let g:waikiki_default_maps = 1 +nn ww :e ~/doc/vimwiki/index.md +"}}} +Plug 'alok/notational-fzf-vim' "{{{ +let g:nv_search_paths = ['~/doc/zettelkasten', '~/doc/wiki'] +"}}} + +"##################### +" Git Support +"##################### +Plug 'tpope/vim-fugitive' "{{{ +nnoremap gs :Gstatus +nnoremap gr :Gremove +nnoremap gl :Glog +nnoremap gb :Gblame +nnoremap gm :Gmove +nnoremap gp :Ggrep +nnoremap gR :Gread +nnoremap gg :Git +nnoremap gd :Gdiff +"}}} +Plug 'junegunn/gv.vim' +Plug 'mhinz/vim-signify' "{{{ +let g:signify_vcs_list = [ 'git' ] +let g:signify_disable_by_default = 0 +let g:signify_realtime = 0 +nmap (SignifyToggle) +"}}} + +"######################### +" Web Programming Support +"######################### +Plug 'pangloss/vim-javascript' +Plug 'mxw/vim-jsx' +Plug 'mattn/emmet-vim' +Plug 'othree/html5.vim' +Plug 'lumiliet/vim-twig' +Plug 'evanleck/vim-svelte' +Plug 'jparise/vim-graphql' +Plug 'ap/vim-css-color' + +"######################### +" Language support +"######################### +Plug 'vim-perl/vim-perl' +Plug 'fatih/vim-go', { 'do': ':GoUpdateBinaries' } "{{{ +let g:go_addtags_transform = "camelcase" +autocmd FileType go nmap MM (go-build) +autocmd FileType go nmap LL (go-run) +autocmd FileType go nmap TT (go-test) +autocmd FileType go nmap i (go-info) +"}}} + +"######################### +" Theme / Interface +"######################### +let g:lightline = {'colorscheme': 'powerline'} +Plug 'itchyny/lightline.vim' "{{{ +let g:lightline = { + \ 'active': { + \ 'left': [ [ 'mode', 'paste' ], + \ [ 'gitbranch', 'readonly', 'filename', 'modified', 'pencil' ] ] + \ }, + \ 'component_function': { + \ 'gitbranch': 'fugitive#statusline', + \ 'pencil': 'PencilMode' + \ }, + \ } +"}}} +Plug 'morhetz/gruvbox' + +call plug#end() +"}}} +" Vim sensible settings {{{ +set nocompatible +set encoding=utf8 +set lazyredraw +"Always show the status line +set laststatus=2 +"Set incremental searching" +set incsearch +"highlighting of search matches +set hlsearch +"ignore case in search patterns +set ignorecase +"overwrite ignorecase if upper case chars +set smartcase +"Show line numbers +set number +"keep cursor in the same column +set nostartofline +"Write the old file out when switching between files. +set autowrite +"read file if changed outside +set autoread +"show line and column of cursor +set ruler +" Enable highlighting of the current line +" set cursorline + +set wildmenu wildignorecase wildmode=list:longest,full +set history=1000 +set completeopt+=menuone +set completeopt+=noselect +set cpt=.,w,b,t +" set completeopt+=noinsert + +"Show command in bottom right portion of the screen +set showcmd +set noshowmode +set shortmess+=c +set belloff+=ctrlg + +"Switch between buffers without saving +set hidden +set splitbelow +set splitright +set display+=lastline + +"Enable code folding +" set foldenable foldmethod=syntax + +"Ever notice a slight lag after typing the leader key + command? +"This lowers the timeout. +set timeoutlen=500 ttimeoutlen=50 + +"Hide mouse when typing +set mousehide +set mouse=a + +"Tab stuff +set tabstop=4 +set shiftwidth=4 +set softtabstop=4 +set smarttab +set expandtab + +"Indent stuff +set smartindent +set autoindent +set breakindent + +"Prefer a slightly higher line height +set linespace=3 + +set switchbuf=useopen +set updatetime=500 +set synmaxcol=400 + +" Enable tab markers +let g:indentLine_char = '⦙' + +"Better line wrapping +set nowrap +set formatoptions+=j + +filetype plugin indent on +syntax on + +" better backup, swap and undo storage +set noswapfile +set backup +set undofile + +set backupdir=~/.vim/dirs/backup +set undodir=~/.vim/dirs/undo + +set thesaurus=~/.vim/thesaurus/english.txt +set spellfile=~/.vim/spell/en.utf8.add +set spelllang=en_us + +set diffopt+=algorithm:patience +set diffopt+=vertical +" hi SpellBad gui=underline guifg=red cterm=underline ctermfg=red +"}}} +" Theme and Styling {{{ +if has('gui_running') + set guifont=BrutalistMono:h14 + " Scrollbar junk + set guioptions=aAcei + set go-=T + set ballooneval + autocmd GUIEnter * set novisualbell t_vb= +endif + +let &t_8f = "\[38;2;%lu;%lu;%lum" +let &t_8b = "\[48;2;%lu;%lu;%lum" +set termguicolors +let g:gruvbox_contrast_dark = 'hard' +let g:gruvbox_italic=0 +colorscheme gruvbox +set background=dark +"}}} +" Filetype settings {{{ + + function! Prose() + call pencil#init({'wrap': 'hard', 'autoformat': 1}) + call lexical#init() + call litecorrect#init() + call textobj#quote#init() + call textobj#sentence#init() + + colorscheme pencil + DittoOn + + " manual reformatting shortcuts + nnoremap Q gqap + xnoremap Q gq + nnoremap Q vapJgqap + + " force top correction on most recent misspelling + nnoremap [s1z= + inoremap u[s1z=`]Au + + " replace common punctuation + iabbrev -- – + iabbrev --- — + iabbrev << « + iabbrev >> » + + " open most folds + setlocal foldlevel=6 + + " replace typographical quotes (reedes/vim-textobj-quote) + map qc ReplaceWithCurly + map qs ReplaceWithStraight + + " highlight words (reedes/vim-wordy) + noremap :NextWordy + xnoremap :NextWordy + inoremap :NextWordy +endfunction + +augroup CustomFiletype + autocmd BufNewFile,BufRead *.md set filetype=markdown + autocmd FileType python,vim,yaml setlocal foldmethod=indent + autocmd FileType qf wincmd J +augroup END + +:autocmd! BufNewFile,BufRead * setlocal nowrap +:autocmd! BufNewFile,BufRead *.txt,*.md,*.tex setlocal wrap + +autocmd BufNewFile,BufRead ~/.mutt/temp/* set noautoindent filetype=mail wm=0 tw=78 nonumber digraph nolist nofen +autocmd BufNewFile,BufRead /dev/shm/gopass.* setlocal noswapfile nobackup noundofile +autocmd FileType help wincmd L +autocmd FileType fugitive wincmd L +autocmd FileType yaml setlocal ts=2 sts=2 sw=2 expandtab +" autocmd FileType markdown,mkd call Prose() +"}}} +" Mappings {{{ +"allow deletion of previously entered data in insert mode +set backspace=indent,eol,start + +" When pressing cd switch to the directory of the open buffer +map cd :cd %:p:h + +"------ Disable Annoying Features ------ +" Wtf is Ex Mode anyways? +nnoremap Q + +" Annoying window +map q: :q + +" Accidentally pressing Shift K will no longer open stupid man entry +noremap K + +" Shortcut to close quickfix windows +nnoremap a :windo lcl\|ccl + +"------ Buffer Navigation ------ +" q Closes the current buffer +nnoremap q :bdelete + +" replace ex mode map and use it for repeating 'q' macro +nnoremap Q @q +vnoremap Q :norm @q + +" clear the search buffer when hitting return +nnoremap :nohlsearch + +if get(g:, 'elite_mode') + nnoremap :resize -2 + nnoremap :resize +2 + nnoremap :vertical resize -2 + nnoremap :vertical resize +2 +endif + +" Easier in-file navigation with Tab and S-Tab +nnoremap +nnoremap + +" Toggle all folds with F2 +nnoremap zR +" nnoremap zM + +nnoremap :PencilToggle +nnoremap :MUcompleteAutoToggle + +nmap i=strftime("%Y-%m-%d %H:%M") +imap =strftime("%Y-%m-%d %H:%M") + +map :TagbarToggle +map :NERDTreeToggle + +" Easier split navigation +nnoremap +nnoremap +nnoremap +nnoremap + +" switch tabs with Ctrl left and right +nnoremap :tabnext +nnoremap :tabprevious +" and whilst in insert mode +inoremap :tabnext +inoremap :tabprevious + +"------ Text Editing Utilities ------ +" U = Deletes Unwanted empty lines +nmap U :g/^$/d + +" R = Converts tabs to spaces in document +nmap R :retab + +" gq will wrap lines, so gQ will unwrap lines +nmap gQ VipJ + +command! -nargs=0 Prose call Prose() +"}}} From 75ffdc27778ddad16c7862dab6ee74b4896d38e8 Mon Sep 17 00:00:00 2001 From: moebiusband Date: Sat, 11 Feb 2023 13:59:31 +0100 Subject: [PATCH 3/3] Delete '.vimrc' --- .vimrc | 546 --------------------------------------------------------- 1 file changed, 546 deletions(-) delete mode 100644 .vimrc diff --git a/.vimrc b/.vimrc deleted file mode 100644 index 45ca7f4..0000000 --- a/.vimrc +++ /dev/null @@ -1,546 +0,0 @@ -" vim: fdm=marker ts=2 sts=2 sw=2 - -if has('python3') - silent! python3 1 -endif - -let mapleader = "\" -let maplocalleader = "\\" -map -let g:elite_mode=1 - -source ~/.vim/local.vim - -" Plugins {{{ -call plug#begin('~/.vim/plugged') -"########### -" Utility -"########### -Plug '~/.fzf' -Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' } "{{{ -let NERDTreeShowHidden=0 -let NERDTreeMinimalUI = 1 -let NERDTreeDirArrows = 1 -"}}} -Plug 'preservim/tagbar', { 'on': 'TagbarToggle' } "{{{ - -"}}} -Plug 'lifepillar/vim-mucomplete' "{{{ -let g:mucomplete#chains = { - \ 'default': ['c-p', 'omni'], - \ 'markdown': ['keyp', 'thes', 'spel', 'dict'], - \ 'tex': ['keyp', 'ulti', 'spel', 'thes', 'dict'] - \ } -inoremap MyCR mucomplete#ultisnips#expand_snippet("\") -imap MyCR -inoremap pumvisible() ? "\" : "\u\" -inoremap (MUcompleteFwdKey) -imap (MUcompleteCycFwd) -inoremap (MUcompleteBwdKey) -imap (MUcompleteCycBwd) -"}}} -"Plug 'sirver/ultisnips' "{{{ -"let g:UltiSnipsSnippetDirectories =[$HOME.'/.vim/plugged/vim-snippets/UltiSnips'] -"let g:UltiSnipsExpandTrigger = "" " Do not use -"let g:UltiSnipsListSnippets = "" " Do not use -"let g:UltiSnipsJumpForwardTrigger = "" " Do not use -""}}} -Plug 'junegunn/fzf.vim' "{{{ -let g:fzf_layout = { 'window': { 'width': 0.9, 'height': 0.6 } } -let g:fzf_preview_window = '' - -nnoremap e :Files -nnoremap E :History -nnoremap b :Buffer -nnoremap c :Commits -nnoremap s :Snippets -" nnoremap a :Ag -nnoremap g :Rg -nnoremap l :BLines -nnoremap L :Lines -nnoremap t :BTags -nnoremap T :Tags -nnoremap h :Helptags -"}}} -Plug 'junegunn/vim-easy-align' "{{{ -xmap gl (EasyAlign) -nmap gl (EasyAlign) -"}}} -Plug 'easymotion/vim-easymotion' "{{{ -let g:EasyMotion_do_mapping = 0 -let g:EasyMotion_smartcase = 1 -" map (easymotion-prefix) -nmap s (easymotion-overwin-f2) -map w (easymotion-bd-w) -nmap w (easymotion-overwin-w) -map j (easymotion-j) -map k (easymotion-k) -"}}} -Plug 'konfekt/fastfold' "{{{ -nmap zuz (FastFoldUpdate) -let g:fastfold_savehook = 1 -let g:tex_fold_enabled = 1 -let g:vimsyn_folding = 'af' -let g:javaScript_fold = 1 -let g:perl_fold = 0 -let g:php_folding = 0 -" }}} -Plug 'tpope/vim-unimpaired' "{{{ -"}}} -Plug 'mhinz/vim-grepper' "{{{ -nnoremap g :Grepper -tool rg -nnoremap G :Grepper -tool ag - -nmap gs (GrepperOperator) -xmap gs (GrepperOperator) - -let g:grepper = {} -let g:grepper.tools = ['rg', 'ag', 'git', 'ack'] -let g:grepper.jump = 1 -let g:grepper.next_tool = 'g' -let g:grepper.simple_prompt = 1 -let g:grepper.quickfix = 0 -"}}} -Plug 'tpope/vim-dispatch' -Plug 'tpope/vim-repeat' -Plug 'tpope/vim-surround' -Plug 'tpope/vim-eunuch' -Plug 'vasconcelloslf/vim-interestingwords' "{{{ -" nnoremap k :call InterestingWords('n') -" nnoremap K :call UncolorAllWords() -" nnoremap n :call WordNavigation('forward') -" nnoremap N :call WordNavigation('backward') -"}}} - -"############################# -" Generic Programming Support -"############################# -Plug 'honza/vim-snippets' -Plug 'jiangmiao/auto-pairs' "{{{ -let g:AutoPairsShortcutFastWrap='' -let g:AutoPairsMapSpace = 0 -imap pumvisible() - \ ? "" - \ : "=AutoPairsSpace()" -let g:AutoPairsMapCR = 0 -let g:AutoPairsMapSpace = 0 -imap pumvisible() - \ ? "" - \ : "=AutoPairsSpace()" - -inoremap UltiExpand - \ mucomplete#ultisnips#expand_snippet("\") -imap MyCR UltiExpandAutoPairsReturn -imap MyCR -"}}} -Plug 'ntpeters/vim-better-whitespace' "{{{ -let g:better_whitespace_filetypes_blacklist=['mail', 'diff', 'gitcommit', 'unite', 'qf', 'help'] -"}}} -Plug 'tpope/vim-commentary' -Plug 'cespare/vim-toml' -Plug 'AndrewRadev/splitjoin.vim' -Plug 'tobyS/vmustache' -Plug 'dense-analysis/ale' "{{{ -let g:ale_sign_error = '✘' -let g:ale_sign_warning = '⚠' -highlight ALEErrorSign ctermbg=NONE ctermfg=red -highlight ALEWarningSign ctermbg=NONE ctermfg=yellow -let g:ale_lint_on_save = 1 -let g:ale_fix_on_save = 1 -let g:ale_lint_on_enter = 0 -let g:ale_lint_on_text_changed = 'never' -set omnifunc=ale#completion#OmniFunc -let g:ale_linter_aliases = {'svelte': ['css', 'javascript']} -let g:ale_linters = { -\ 'javascript': ['standard'], -\ 'svelte': ['stylelint', 'eslint'], -\ 'go': ['go build', 'gometalinter'] -\ } -let g:ale_fixers = { -\ '*': ['remove_trailing_lines', 'trim_whitespace'], -\ 'javascript': ['prettier', 'eslint'], -\ 'svelte': ['eslint', 'prettier', 'prettier_standard'], -\ 'go': ['goimports'] -\ } -let g:gometalinter_fast = '' - \ . ' --enable=vet' - \ . ' --enable=errcheck' - \ . ' --enable=ineffassign' - \ . ' --enable=goimports' - \ . ' --enable=misspell' - \ . ' --enable=lll --line-length=120' -let g:ale_go_gometalinter_options = '--disable-all --tests' . g:gometalinter_fast . ' --enable=golint' -"}}} - -"##################### -" Markdown / Writing -"##################### -Plug 'dbmrq/vim-ditto' "{{{ -" au FileType markdown,text,tex DittoOn -nmap di ToggleDitto " Turn Ditto on and off -nmap =d DittoNext " Jump to the next word -nmap -d DittoPrev " Jump to the previous word -nmap +d DittoGood " Ignore the word under the cursor -nmap _d DittoBad " Stop ignoring the word under the cursor -nmap ]d DittoMore " Show the next matches -nmap [d DittoLess " Show the previous matches -"}}} -Plug 'kana/vim-textobj-user' -Plug 'reedes/vim-textobj-quote' -Plug 'reedes/vim-textobj-sentence' -Plug 'reedes/vim-wordy' "{{{ -" let g:wordy_spell_dir = '~/.vim/spell/wordy' -"}}} -Plug 'reedes/vim-lexical' "{{{ -let g:lexical#thesaurus = ['~/.vim/thesaurus/english.txt',] -let g:lexical#spellfile = ['~/.vim/spell/en.utf-8.add',] -let g:lexical#thesaurus_key = 't' -let g:lexical#dictionary_key = 'k' -"}}} -Plug 'reedes/vim-litecorrect' -Plug 'reedes/vim-pencil' "{{{ -let g:pencil#map#suspend_af = 'K' -"}}} -Plug 'tpope/vim-abolish' -Plug 'tpope/vim-markdown' -Plug 'iamcco/markdown-preview.nvim', { 'do': 'cd app && yarn install' } "{{{ -let g:mkdp_refresh_slow = 1 -"}}} -Plug 'lervag/vimtex' "{{{ -let g:tex_flavor = 'latex' -"}}} - -"##################### -" Productivity -"##################### -Plug 'fcpg/vim-waikiki' "{{{ -let g:waikiki_roots = ['~/doc/vimwiki/'] -let g:waikiki_default_maps = 1 -nn ww :e ~/doc/vimwiki/index.md -"}}} -Plug 'alok/notational-fzf-vim' "{{{ -let g:nv_search_paths = ['~/doc/zettelkasten', '~/doc/wiki'] -"}}} - -"##################### -" Git Support -"##################### -Plug 'tpope/vim-fugitive' "{{{ -nnoremap gs :Gstatus -nnoremap gr :Gremove -nnoremap gl :Glog -nnoremap gb :Gblame -nnoremap gm :Gmove -nnoremap gp :Ggrep -nnoremap gR :Gread -nnoremap gg :Git -nnoremap gd :Gdiff -"}}} -Plug 'junegunn/gv.vim' -Plug 'mhinz/vim-signify' "{{{ -let g:signify_vcs_list = [ 'git' ] -let g:signify_disable_by_default = 0 -let g:signify_realtime = 0 -nmap (SignifyToggle) -"}}} - -"######################### -" Web Programming Support -"######################### -Plug 'pangloss/vim-javascript' -Plug 'mxw/vim-jsx' -Plug 'mattn/emmet-vim' -Plug 'othree/html5.vim' -Plug 'lumiliet/vim-twig' -Plug 'evanleck/vim-svelte' -Plug 'jparise/vim-graphql' -Plug 'ap/vim-css-color' - -"######################### -" Language support -"######################### -Plug 'vim-perl/vim-perl' -Plug 'fatih/vim-go', { 'do': ':GoUpdateBinaries' } "{{{ -let g:go_addtags_transform = "camelcase" -autocmd FileType go nmap MM (go-build) -autocmd FileType go nmap LL (go-run) -autocmd FileType go nmap TT (go-test) -autocmd FileType go nmap i (go-info) -"}}} - -"######################### -" Theme / Interface -"######################### -let g:lightline = {'colorscheme': 'powerline'} -Plug 'itchyny/lightline.vim' "{{{ -let g:lightline = { - \ 'active': { - \ 'left': [ [ 'mode', 'paste' ], - \ [ 'gitbranch', 'readonly', 'filename', 'modified', 'pencil' ] ] - \ }, - \ 'component_function': { - \ 'gitbranch': 'fugitive#statusline', - \ 'pencil': 'PencilMode' - \ }, - \ } -"}}} -Plug 'morhetz/gruvbox' - -call plug#end() -"}}} -" Vim sensible settings {{{ -set nocompatible -set encoding=utf8 -set lazyredraw -"Always show the status line -set laststatus=2 -"Set incremental searching" -set incsearch -"highlighting of search matches -set hlsearch -"ignore case in search patterns -set ignorecase -"overwrite ignorecase if upper case chars -set smartcase -"Show line numbers -set number -"keep cursor in the same column -set nostartofline -"Write the old file out when switching between files. -set autowrite -"read file if changed outside -set autoread -"show line and column of cursor -set ruler -" Enable highlighting of the current line -" set cursorline - -set wildmenu wildignorecase wildmode=list:longest,full -set history=1000 -set completeopt+=menuone -set completeopt+=noselect -set cpt=.,w,b,t -" set completeopt+=noinsert - -"Show command in bottom right portion of the screen -set showcmd -set noshowmode -set shortmess+=c -set belloff+=ctrlg - -"Switch between buffers without saving -set hidden -set splitbelow -set splitright -set display+=lastline - -"Enable code folding -" set foldenable foldmethod=syntax - -"Ever notice a slight lag after typing the leader key + command? -"This lowers the timeout. -set timeoutlen=500 ttimeoutlen=50 - -"Hide mouse when typing -set mousehide -set mouse=a - -"Tab stuff -set tabstop=4 -set shiftwidth=4 -set softtabstop=4 -set smarttab -set expandtab - -"Indent stuff -set smartindent -set autoindent -set breakindent - -"Prefer a slightly higher line height -set linespace=3 - -set switchbuf=useopen -set updatetime=500 -set synmaxcol=400 - -" Enable tab markers -let g:indentLine_char = '⦙' - -"Better line wrapping -set nowrap -set formatoptions+=j - -filetype plugin indent on -syntax on - -" better backup, swap and undo storage -set noswapfile -set backup -set undofile - -set backupdir=~/.vim/dirs/backup -set undodir=~/.vim/dirs/undo - -set thesaurus=~/.vim/thesaurus/english.txt -set spellfile=~/.vim/spell/en.utf8.add -set spelllang=en_us - -set diffopt+=algorithm:patience -set diffopt+=vertical -" hi SpellBad gui=underline guifg=red cterm=underline ctermfg=red -"}}} -" Theme and Styling {{{ -if has('gui_running') - set guifont=BrutalistMono:h14 - " Scrollbar junk - set guioptions=aAcei - set go-=T - set ballooneval - autocmd GUIEnter * set novisualbell t_vb= -endif - -let &t_8f = "\[38;2;%lu;%lu;%lum" -let &t_8b = "\[48;2;%lu;%lu;%lum" -set termguicolors -let g:gruvbox_contrast_dark = 'hard' -let g:gruvbox_italic=0 -colorscheme gruvbox -set background=dark -"}}} -" Filetype settings {{{ - - function! Prose() - call pencil#init({'wrap': 'hard', 'autoformat': 1}) - call lexical#init() - call litecorrect#init() - call textobj#quote#init() - call textobj#sentence#init() - - colorscheme pencil - DittoOn - - " manual reformatting shortcuts - nnoremap Q gqap - xnoremap Q gq - nnoremap Q vapJgqap - - " force top correction on most recent misspelling - nnoremap [s1z= - inoremap u[s1z=`]Au - - " replace common punctuation - iabbrev -- – - iabbrev --- — - iabbrev << « - iabbrev >> » - - " open most folds - setlocal foldlevel=6 - - " replace typographical quotes (reedes/vim-textobj-quote) - map qc ReplaceWithCurly - map qs ReplaceWithStraight - - " highlight words (reedes/vim-wordy) - noremap :NextWordy - xnoremap :NextWordy - inoremap :NextWordy -endfunction - -augroup CustomFiletype - autocmd BufNewFile,BufRead *.md set filetype=markdown - autocmd FileType python,vim,yaml setlocal foldmethod=indent - autocmd FileType qf wincmd J -augroup END - -:autocmd! BufNewFile,BufRead * setlocal nowrap -:autocmd! BufNewFile,BufRead *.txt,*.md,*.tex setlocal wrap - -autocmd BufNewFile,BufRead ~/.mutt/temp/* set noautoindent filetype=mail wm=0 tw=78 nonumber digraph nolist nofen -autocmd BufNewFile,BufRead /dev/shm/gopass.* setlocal noswapfile nobackup noundofile -autocmd FileType help wincmd L -autocmd FileType fugitive wincmd L -autocmd FileType yaml setlocal ts=2 sts=2 sw=2 expandtab -" autocmd FileType markdown,mkd call Prose() -"}}} -" Mappings {{{ -"allow deletion of previously entered data in insert mode -set backspace=indent,eol,start - -" When pressing cd switch to the directory of the open buffer -map cd :cd %:p:h - -"------ Disable Annoying Features ------ -" Wtf is Ex Mode anyways? -nnoremap Q - -" Annoying window -map q: :q - -" Accidentally pressing Shift K will no longer open stupid man entry -noremap K - -" Shortcut to close quickfix windows -nnoremap a :windo lcl\|ccl - -"------ Buffer Navigation ------ -" q Closes the current buffer -nnoremap q :bdelete - -" replace ex mode map and use it for repeating 'q' macro -nnoremap Q @q -vnoremap Q :norm @q - -" clear the search buffer when hitting return -nnoremap :nohlsearch - -if get(g:, 'elite_mode') - nnoremap :resize -2 - nnoremap :resize +2 - nnoremap :vertical resize -2 - nnoremap :vertical resize +2 -endif - -" Easier in-file navigation with Tab and S-Tab -nnoremap -nnoremap - -" Toggle all folds with F2 -nnoremap zR -" nnoremap zM - -nnoremap :PencilToggle -nnoremap :MUcompleteAutoToggle - -nmap i=strftime("%Y-%m-%d %H:%M") -imap =strftime("%Y-%m-%d %H:%M") - -map :TagbarToggle -map :NERDTreeToggle - -" Easier split navigation -nnoremap -nnoremap -nnoremap -nnoremap - -" switch tabs with Ctrl left and right -nnoremap :tabnext -nnoremap :tabprevious -" and whilst in insert mode -inoremap :tabnext -inoremap :tabprevious - -"------ Text Editing Utilities ------ -" U = Deletes Unwanted empty lines -nmap U :g/^$/d - -" R = Converts tabs to spaces in document -nmap R :retab - -" gq will wrap lines, so gQ will unwrap lines -nmap gQ VipJ - -command! -nargs=0 Prose call Prose() -"}}}