diff .vimrc @ 246:6af02446233f

New Vim plugin manager and its configuration should make things more portable
author Steve Huston <huston@srhuston.net>
date Tue, 26 Mar 2024 12:15:41 -0400
parents 6e7913283c7a
children fe6f4e3da0e7
line wrap: on
line diff
--- a/.vimrc	Tue Mar 26 11:41:34 2024 -0400
+++ b/.vimrc	Tue Mar 26 12:15:41 2024 -0400
@@ -1,19 +1,105 @@
 version 5.0
 set nocompatible
+set mouse=a
+set background=dark
+set textwidth=78
+set showmatch
+set hls
+hi Normal guibg=black guifg=white
+autocmd FileType make setlocal noet | setlocal ts=8 | setlocal sw=8
+
+" These might not be needed with the inclusion of vim-sleuth now...
 set autoindent
 set cindent
-set mouse=a
 set smartindent
 set smarttab
 set tabstop=4
 set shiftwidth=2
 set softtabstop=2
 set expandtab
-syntax on
-set background=dark
-set textwidth=78
-set showmatch
-set hls
-hi Normal guibg=black guifg=white
-autocmd FileType make setlocal noet | setlocal ts=8 | setlocal sw=8
-filetype plugin indent on
+
+" Don't need these anymore since the plug#end below calls it
+"syntax on
+"filetype plugin indent on
+
+call plug#begin()
+" The default plugin directory will be as follows:
+"   - Vim (Linux/macOS): '~/.vim/plugged'
+"   - Vim (Windows): '~/vimfiles/plugged'
+"   - Neovim (Linux/macOS/Windows): stdpath('data') . '/plugged'
+" You can specify a custom plugin directory by passing it as the argument
+"   - e.g. `call plug#begin('~/.vim/plugged')`
+"   - Avoid using standard Vim directory names like 'plugin'
+
+" Make sure you use single quotes
+
+" ========== My plugins here ==========
+" automatically adjusts 'shiftwidth' and 'expandtab' heuristically
+Plug 'tpope/vim-sleuth'
+
+" visually displays indent levels
+Plug 'preservim/vim-indent-guides'
+
+" wisely 'ends' structures (think do/done in bash, if/fi, etc)
+Plug 'tpope/vim-endwise'
+
+" closes brackets
+Plug 'rstacruz/vim-closer'
+
+" provides mappings to easily delete, change and add surroundings (quotes, HTML tags, etc) in pairs
+Plug 'tpope/vim-surround'
+
+" highlights whitespace at the end of lines
+Plug 'ntpeters/vim-better-whitespace'
+
+" markdown syntax highlighting and whatnot (better than the built-in which is similar to tpope from what I can tell)
+Plug 'gabrielelana/vim-markdown'
+
+" gnupg integration (replaces the one I had before)
+Plug 'jamessan/vim-gnupg'
+
+" puppet syntax, indenting, etc - recommended by maintainers of the one I had before
+Plug 'rodjek/vim-puppet'
+
+" ========== My plugins end ==========
+" Below are the examples (commented out) that came with plug
+
+" Shorthand notation for GitHub; translates to https://github.com/junegunn/vim-easy-align
+"Plug 'junegunn/vim-easy-align'
+
+" Any valid git URL is allowed
+"Plug 'https://github.com/junegunn/seoul256.vim.git'
+
+" Using a tagged release; wildcard allowed (requires git 1.9.2 or above)
+"Plug 'fatih/vim-go', { 'tag': '*' }
+
+" Using a non-default branch
+"Plug 'neoclide/coc.nvim', { 'branch': 'release' }
+
+" Use 'dir' option to install plugin in a non-default directory
+"Plug 'junegunn/fzf', { 'dir': '~/.fzf' }
+
+" Post-update hook: run a shell command after installing or updating the plugin
+"Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
+
+" Post-update hook can be a lambda expression
+"Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
+
+" If the vim plugin is in a subdirectory, use 'rtp' option to specify its path
+"Plug 'nsf/gocode', { 'rtp': 'vim' }
+
+" On-demand loading: loaded when the specified command is executed
+"Plug 'preservim/nerdtree', { 'on': 'NERDTreeToggle' }
+
+" On-demand loading: loaded when a file with a specific file type is opened
+"Plug 'tpope/vim-fireplace', { 'for': 'clojure' }
+
+" Unmanaged plugin (manually installed and updated)
+"Plug '~/my-prototype-plugin'
+
+" Initialize plugin system
+" - Automatically executes `filetype plugin indent on` and `syntax enable`.
+call plug#end()
+" You can revert the settings after the call like so:
+"   filetype indent off   " Disable file-type-specific indentation
+"   syntax off            " Disable syntax highlighting