From f0c74d95f54c170cffbdcd8c6fae37c3e14be699 Mon Sep 17 00:00:00 2001 From: "Zed A. Shaw" Date: Wed, 29 Jun 2022 06:01:42 -0400 Subject: [PATCH] Adding some initial information. --- README.md | 49 +++++++++++++++++++- _vimrc | 131 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 178 insertions(+), 2 deletions(-) create mode 100644 _vimrc diff --git a/README.md b/README.md index 1b5e230..e620ae5 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,48 @@ -# windows-vim +This is a quick dump of my windows Vim setup. I run +gvim on windows with this setup and also in the browser. -This is a quick dump of my windows vim setup. This works fairly well and I've written a lot of software using this. I also include other software I installed. \ No newline at end of file +This is the list of vim-plugins that I install via pathogen: + +``` +ale +bufexplorer +codi.vim +emmet-vim +fzf +fzf.vim +html5.vim +ListToggle +nim.vim +scss-syntax.vim +tagbar +tlib_vim +vim-addon-mw-utils +vim-css3-syntax +vim-dispatch +vim-easymotion +vim-fugitive +vim-gitgutter +vim-indent-guides +vim-javascript +vim-sensible +vim-snipmate +vim-snippets +vim-surround +vim-svelte +vim-test +``` + +Remove what you don't want. I also have the following software installed: + +Software +== + +[PowerToys](https://github.com/microsoft/PowerToys) - Remap keys and other useful things like alt-space search. +[AG](https://github.com/ggreer/the_silver_searcher) - Good code search, but not good all files search. +[RipGrep](https://github.com/BurntSushi/ripgrep) -- Mediocre grep alternative. It works but it will consistently skip files in arbitrary situations for "speed". +[cmder](https://cmder.net/) -- A PowerShell reskin/terminal that includes most of the stuff you need as a developer, like git. Also has something called "posh git" that gives improved CLI status, but it's slow so consider removing it. + +Fonts +== + +[VictorMono](https://rubjo.github.io/victor-mono/) -- Great for Vim, but on the web the author decided to _by default_ enable sigils that convert code text to arbitrary math symbols nobody wants. diff --git a/_vimrc b/_vimrc new file mode 100644 index 0000000..ad4f6b8 --- /dev/null +++ b/_vimrc @@ -0,0 +1,131 @@ +execute pathogen#infect() +syntax enable +filetype plugin indent on + +set diffopt+=iwhite,vertical +set fileformat=unix +set statusline+=%#warningmsg# +set statusline+=%* + +" my customizations from my previous +nmap S :setlocal spell spelllang=en_us +set number +nmap M :wa:make! +nmap D :w:diffthis +nmap d :w:diffoff +nmap f (easymotion-bd-f) +nmap F (easymotion-overwin-f) +nmap n :cnext +nmap p :cprevious + +nmap g :Ag +nmap f :Files +nmap b :Buffers + +" under windows not a damn thing about dispatch or test works +" you have to reconfigure vim to use powershell then you have +" run: +" +" Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope CurrentUser +set shell=powershell +set shellcmdflag=-c +set shellquote=\" +set shellxquote= + +nmap T :TestSuite +set grepprg=rg\ --vimgrep +colorscheme industry + +" set sane autoindent and 4 space soft tabs +syntax enable +set cindent +set nopaste " people say this has to be off +set tabstop=4 +set shiftwidth=2 +set softtabstop=2 +set expandtab +set autoindent +set smartindent + +autocmd FileType js setlocal shiftwidth=2 softtabstop=2 expandtab +autocmd FileType svelte setlocal shiftwidth=2 softtabstop=2 expandtab +autocmd FileType markdown setl noai nocin nosi inde= tw=100 + +set guifont=Consolas:h22:cANSI:qDRAFT +set hidden + +nnoremap +nnoremap <2-MiddleMouse> +nnoremap <3-MiddleMouse> +nnoremap <4-MiddleMouse> + +inoremap +inoremap <2-MiddleMouse> +inoremap <3-MiddleMouse> +inoremap <4-MiddleMouse> + +nnoremap :setl noai nocin nosi inde= tw=100 +set visualbell + +augroup VimCSS3Syntax + autocmd! + + autocmd FileType css setlocal iskeyword+=- +augroup END + +let g:gitgutter_git_executable = 'C:\Shared\cmder\vendor\git-for-windows\bin\git.exe' + +highlight clear SignColumn +highlight GitGutterAdd ctermfg=green guifg=darkgreen +highlight GitGutterChange ctermfg=yellow guifg=darkyellow +highlight GitGutterDelete ctermfg=red guifg=darkred +highlight GitGutterChangeDelete ctermfg=yellow guifg=darkyellow + +let g:indent_guides_guide_size = 1 +let g:indent_guides_color_change_percent = 3 +let g:indent_guides_enable_on_vim_startup = 1 + +let test#strategy = "dispatch" + +let g:ale_linter_aliases = { +\ 'svelte': ['css', 'javascript'], +\ 'css': ['css'], +\} + +let g:ale_linters = { +\ 'css': ['stylelint'], +\ 'svelte': ['stylelint', 'eslint'], +\ 'javascript': ['eslint'], +\ 'nim': ['nimlsp', 'nimcheck'], +\} + +let g:ale_fixers = { +\ '*': ['remove_trailing_lines', 'trim_whitespace'], +\ 'nim': ['nimpretty'], +\} + +let g:ale_linters_explicit = 1 +let g:ale_set_loclist = 0 +let g:ale_set_quickfix = 0 +let g:ale_lint_on_text_changed = 'never' +let g:ale_lint_on_insert_leave = 0 +let g:ale_fix_on_save = 1 +let g:ale_sign_error = '!' +let g:ale_sign_warning = '?' +highlight ALEErrorSign guifg=Red +highlight ALEWarningSign guifg=Yellow + +set ff=unix +set ffs=unix + +fun! JumpToDef() + if exists("*GotoDefinition_" . &filetype) + call GotoDefinition_{&filetype}() + else + exe "norm! \" + endif +endf + +" Jump to tag +nn :call JumpToDef() +ino :call JumpToDef()i