annotate .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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
c78481cfb082 Initial checkin:
huston@80426f53-59d1-405d-934b-f07cd76f4a1a
parents:
diff changeset
1 version 5.0
c78481cfb082 Initial checkin:
huston@80426f53-59d1-405d-934b-f07cd76f4a1a
parents:
diff changeset
2 set nocompatible
246
6af02446233f New Vim plugin manager and its configuration should make things more portable
Steve Huston <huston@srhuston.net>
parents: 198
diff changeset
3 set mouse=a
6af02446233f New Vim plugin manager and its configuration should make things more portable
Steve Huston <huston@srhuston.net>
parents: 198
diff changeset
4 set background=dark
6af02446233f New Vim plugin manager and its configuration should make things more portable
Steve Huston <huston@srhuston.net>
parents: 198
diff changeset
5 set textwidth=78
6af02446233f New Vim plugin manager and its configuration should make things more portable
Steve Huston <huston@srhuston.net>
parents: 198
diff changeset
6 set showmatch
6af02446233f New Vim plugin manager and its configuration should make things more portable
Steve Huston <huston@srhuston.net>
parents: 198
diff changeset
7 set hls
6af02446233f New Vim plugin manager and its configuration should make things more portable
Steve Huston <huston@srhuston.net>
parents: 198
diff changeset
8 hi Normal guibg=black guifg=white
6af02446233f New Vim plugin manager and its configuration should make things more portable
Steve Huston <huston@srhuston.net>
parents: 198
diff changeset
9 autocmd FileType make setlocal noet | setlocal ts=8 | setlocal sw=8
6af02446233f New Vim plugin manager and its configuration should make things more portable
Steve Huston <huston@srhuston.net>
parents: 198
diff changeset
10
6af02446233f New Vim plugin manager and its configuration should make things more portable
Steve Huston <huston@srhuston.net>
parents: 198
diff changeset
11 " These might not be needed with the inclusion of vim-sleuth now...
0
c78481cfb082 Initial checkin:
huston@80426f53-59d1-405d-934b-f07cd76f4a1a
parents:
diff changeset
12 set autoindent
c78481cfb082 Initial checkin:
huston@80426f53-59d1-405d-934b-f07cd76f4a1a
parents:
diff changeset
13 set cindent
c78481cfb082 Initial checkin:
huston@80426f53-59d1-405d-934b-f07cd76f4a1a
parents:
diff changeset
14 set smartindent
c78481cfb082 Initial checkin:
huston@80426f53-59d1-405d-934b-f07cd76f4a1a
parents:
diff changeset
15 set smarttab
27
a6c93cf45e90 * New changes to tab stuff, see if I like it better
huston@80426f53-59d1-405d-934b-f07cd76f4a1a
parents: 19
diff changeset
16 set tabstop=4
a6c93cf45e90 * New changes to tab stuff, see if I like it better
huston@80426f53-59d1-405d-934b-f07cd76f4a1a
parents: 19
diff changeset
17 set shiftwidth=2
a6c93cf45e90 * New changes to tab stuff, see if I like it better
huston@80426f53-59d1-405d-934b-f07cd76f4a1a
parents: 19
diff changeset
18 set softtabstop=2
a6c93cf45e90 * New changes to tab stuff, see if I like it better
huston@80426f53-59d1-405d-934b-f07cd76f4a1a
parents: 19
diff changeset
19 set expandtab
246
6af02446233f New Vim plugin manager and its configuration should make things more portable
Steve Huston <huston@srhuston.net>
parents: 198
diff changeset
20
6af02446233f New Vim plugin manager and its configuration should make things more portable
Steve Huston <huston@srhuston.net>
parents: 198
diff changeset
21 " Don't need these anymore since the plug#end below calls it
6af02446233f New Vim plugin manager and its configuration should make things more portable
Steve Huston <huston@srhuston.net>
parents: 198
diff changeset
22 "syntax on
6af02446233f New Vim plugin manager and its configuration should make things more portable
Steve Huston <huston@srhuston.net>
parents: 198
diff changeset
23 "filetype plugin indent on
6af02446233f New Vim plugin manager and its configuration should make things more portable
Steve Huston <huston@srhuston.net>
parents: 198
diff changeset
24
6af02446233f New Vim plugin manager and its configuration should make things more portable
Steve Huston <huston@srhuston.net>
parents: 198
diff changeset
25 call plug#begin()
6af02446233f New Vim plugin manager and its configuration should make things more portable
Steve Huston <huston@srhuston.net>
parents: 198
diff changeset
26 " The default plugin directory will be as follows:
6af02446233f New Vim plugin manager and its configuration should make things more portable
Steve Huston <huston@srhuston.net>
parents: 198
diff changeset
27 " - Vim (Linux/macOS): '~/.vim/plugged'
6af02446233f New Vim plugin manager and its configuration should make things more portable
Steve Huston <huston@srhuston.net>
parents: 198
diff changeset
28 " - Vim (Windows): '~/vimfiles/plugged'
6af02446233f New Vim plugin manager and its configuration should make things more portable
Steve Huston <huston@srhuston.net>
parents: 198
diff changeset
29 " - Neovim (Linux/macOS/Windows): stdpath('data') . '/plugged'
6af02446233f New Vim plugin manager and its configuration should make things more portable
Steve Huston <huston@srhuston.net>
parents: 198
diff changeset
30 " You can specify a custom plugin directory by passing it as the argument
6af02446233f New Vim plugin manager and its configuration should make things more portable
Steve Huston <huston@srhuston.net>
parents: 198
diff changeset
31 " - e.g. `call plug#begin('~/.vim/plugged')`
6af02446233f New Vim plugin manager and its configuration should make things more portable
Steve Huston <huston@srhuston.net>
parents: 198
diff changeset
32 " - Avoid using standard Vim directory names like 'plugin'
6af02446233f New Vim plugin manager and its configuration should make things more portable
Steve Huston <huston@srhuston.net>
parents: 198
diff changeset
33
6af02446233f New Vim plugin manager and its configuration should make things more portable
Steve Huston <huston@srhuston.net>
parents: 198
diff changeset
34 " Make sure you use single quotes
6af02446233f New Vim plugin manager and its configuration should make things more portable
Steve Huston <huston@srhuston.net>
parents: 198
diff changeset
35
6af02446233f New Vim plugin manager and its configuration should make things more portable
Steve Huston <huston@srhuston.net>
parents: 198
diff changeset
36 " ========== My plugins here ==========
6af02446233f New Vim plugin manager and its configuration should make things more portable
Steve Huston <huston@srhuston.net>
parents: 198
diff changeset
37 " automatically adjusts 'shiftwidth' and 'expandtab' heuristically
6af02446233f New Vim plugin manager and its configuration should make things more portable
Steve Huston <huston@srhuston.net>
parents: 198
diff changeset
38 Plug 'tpope/vim-sleuth'
6af02446233f New Vim plugin manager and its configuration should make things more portable
Steve Huston <huston@srhuston.net>
parents: 198
diff changeset
39
6af02446233f New Vim plugin manager and its configuration should make things more portable
Steve Huston <huston@srhuston.net>
parents: 198
diff changeset
40 " visually displays indent levels
6af02446233f New Vim plugin manager and its configuration should make things more portable
Steve Huston <huston@srhuston.net>
parents: 198
diff changeset
41 Plug 'preservim/vim-indent-guides'
6af02446233f New Vim plugin manager and its configuration should make things more portable
Steve Huston <huston@srhuston.net>
parents: 198
diff changeset
42
6af02446233f New Vim plugin manager and its configuration should make things more portable
Steve Huston <huston@srhuston.net>
parents: 198
diff changeset
43 " wisely 'ends' structures (think do/done in bash, if/fi, etc)
6af02446233f New Vim plugin manager and its configuration should make things more portable
Steve Huston <huston@srhuston.net>
parents: 198
diff changeset
44 Plug 'tpope/vim-endwise'
6af02446233f New Vim plugin manager and its configuration should make things more portable
Steve Huston <huston@srhuston.net>
parents: 198
diff changeset
45
6af02446233f New Vim plugin manager and its configuration should make things more portable
Steve Huston <huston@srhuston.net>
parents: 198
diff changeset
46 " closes brackets
6af02446233f New Vim plugin manager and its configuration should make things more portable
Steve Huston <huston@srhuston.net>
parents: 198
diff changeset
47 Plug 'rstacruz/vim-closer'
6af02446233f New Vim plugin manager and its configuration should make things more portable
Steve Huston <huston@srhuston.net>
parents: 198
diff changeset
48
6af02446233f New Vim plugin manager and its configuration should make things more portable
Steve Huston <huston@srhuston.net>
parents: 198
diff changeset
49 " provides mappings to easily delete, change and add surroundings (quotes, HTML tags, etc) in pairs
6af02446233f New Vim plugin manager and its configuration should make things more portable
Steve Huston <huston@srhuston.net>
parents: 198
diff changeset
50 Plug 'tpope/vim-surround'
6af02446233f New Vim plugin manager and its configuration should make things more portable
Steve Huston <huston@srhuston.net>
parents: 198
diff changeset
51
6af02446233f New Vim plugin manager and its configuration should make things more portable
Steve Huston <huston@srhuston.net>
parents: 198
diff changeset
52 " highlights whitespace at the end of lines
6af02446233f New Vim plugin manager and its configuration should make things more portable
Steve Huston <huston@srhuston.net>
parents: 198
diff changeset
53 Plug 'ntpeters/vim-better-whitespace'
6af02446233f New Vim plugin manager and its configuration should make things more portable
Steve Huston <huston@srhuston.net>
parents: 198
diff changeset
54
6af02446233f New Vim plugin manager and its configuration should make things more portable
Steve Huston <huston@srhuston.net>
parents: 198
diff changeset
55 " markdown syntax highlighting and whatnot (better than the built-in which is similar to tpope from what I can tell)
6af02446233f New Vim plugin manager and its configuration should make things more portable
Steve Huston <huston@srhuston.net>
parents: 198
diff changeset
56 Plug 'gabrielelana/vim-markdown'
6af02446233f New Vim plugin manager and its configuration should make things more portable
Steve Huston <huston@srhuston.net>
parents: 198
diff changeset
57
6af02446233f New Vim plugin manager and its configuration should make things more portable
Steve Huston <huston@srhuston.net>
parents: 198
diff changeset
58 " gnupg integration (replaces the one I had before)
6af02446233f New Vim plugin manager and its configuration should make things more portable
Steve Huston <huston@srhuston.net>
parents: 198
diff changeset
59 Plug 'jamessan/vim-gnupg'
6af02446233f New Vim plugin manager and its configuration should make things more portable
Steve Huston <huston@srhuston.net>
parents: 198
diff changeset
60
6af02446233f New Vim plugin manager and its configuration should make things more portable
Steve Huston <huston@srhuston.net>
parents: 198
diff changeset
61 " puppet syntax, indenting, etc - recommended by maintainers of the one I had before
6af02446233f New Vim plugin manager and its configuration should make things more portable
Steve Huston <huston@srhuston.net>
parents: 198
diff changeset
62 Plug 'rodjek/vim-puppet'
6af02446233f New Vim plugin manager and its configuration should make things more portable
Steve Huston <huston@srhuston.net>
parents: 198
diff changeset
63
6af02446233f New Vim plugin manager and its configuration should make things more portable
Steve Huston <huston@srhuston.net>
parents: 198
diff changeset
64 " ========== My plugins end ==========
6af02446233f New Vim plugin manager and its configuration should make things more portable
Steve Huston <huston@srhuston.net>
parents: 198
diff changeset
65 " Below are the examples (commented out) that came with plug
6af02446233f New Vim plugin manager and its configuration should make things more portable
Steve Huston <huston@srhuston.net>
parents: 198
diff changeset
66
6af02446233f New Vim plugin manager and its configuration should make things more portable
Steve Huston <huston@srhuston.net>
parents: 198
diff changeset
67 " Shorthand notation for GitHub; translates to https://github.com/junegunn/vim-easy-align
6af02446233f New Vim plugin manager and its configuration should make things more portable
Steve Huston <huston@srhuston.net>
parents: 198
diff changeset
68 "Plug 'junegunn/vim-easy-align'
6af02446233f New Vim plugin manager and its configuration should make things more portable
Steve Huston <huston@srhuston.net>
parents: 198
diff changeset
69
6af02446233f New Vim plugin manager and its configuration should make things more portable
Steve Huston <huston@srhuston.net>
parents: 198
diff changeset
70 " Any valid git URL is allowed
6af02446233f New Vim plugin manager and its configuration should make things more portable
Steve Huston <huston@srhuston.net>
parents: 198
diff changeset
71 "Plug 'https://github.com/junegunn/seoul256.vim.git'
6af02446233f New Vim plugin manager and its configuration should make things more portable
Steve Huston <huston@srhuston.net>
parents: 198
diff changeset
72
6af02446233f New Vim plugin manager and its configuration should make things more portable
Steve Huston <huston@srhuston.net>
parents: 198
diff changeset
73 " Using a tagged release; wildcard allowed (requires git 1.9.2 or above)
6af02446233f New Vim plugin manager and its configuration should make things more portable
Steve Huston <huston@srhuston.net>
parents: 198
diff changeset
74 "Plug 'fatih/vim-go', { 'tag': '*' }
6af02446233f New Vim plugin manager and its configuration should make things more portable
Steve Huston <huston@srhuston.net>
parents: 198
diff changeset
75
6af02446233f New Vim plugin manager and its configuration should make things more portable
Steve Huston <huston@srhuston.net>
parents: 198
diff changeset
76 " Using a non-default branch
6af02446233f New Vim plugin manager and its configuration should make things more portable
Steve Huston <huston@srhuston.net>
parents: 198
diff changeset
77 "Plug 'neoclide/coc.nvim', { 'branch': 'release' }
6af02446233f New Vim plugin manager and its configuration should make things more portable
Steve Huston <huston@srhuston.net>
parents: 198
diff changeset
78
6af02446233f New Vim plugin manager and its configuration should make things more portable
Steve Huston <huston@srhuston.net>
parents: 198
diff changeset
79 " Use 'dir' option to install plugin in a non-default directory
6af02446233f New Vim plugin manager and its configuration should make things more portable
Steve Huston <huston@srhuston.net>
parents: 198
diff changeset
80 "Plug 'junegunn/fzf', { 'dir': '~/.fzf' }
6af02446233f New Vim plugin manager and its configuration should make things more portable
Steve Huston <huston@srhuston.net>
parents: 198
diff changeset
81
6af02446233f New Vim plugin manager and its configuration should make things more portable
Steve Huston <huston@srhuston.net>
parents: 198
diff changeset
82 " Post-update hook: run a shell command after installing or updating the plugin
6af02446233f New Vim plugin manager and its configuration should make things more portable
Steve Huston <huston@srhuston.net>
parents: 198
diff changeset
83 "Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
6af02446233f New Vim plugin manager and its configuration should make things more portable
Steve Huston <huston@srhuston.net>
parents: 198
diff changeset
84
6af02446233f New Vim plugin manager and its configuration should make things more portable
Steve Huston <huston@srhuston.net>
parents: 198
diff changeset
85 " Post-update hook can be a lambda expression
6af02446233f New Vim plugin manager and its configuration should make things more portable
Steve Huston <huston@srhuston.net>
parents: 198
diff changeset
86 "Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
6af02446233f New Vim plugin manager and its configuration should make things more portable
Steve Huston <huston@srhuston.net>
parents: 198
diff changeset
87
6af02446233f New Vim plugin manager and its configuration should make things more portable
Steve Huston <huston@srhuston.net>
parents: 198
diff changeset
88 " If the vim plugin is in a subdirectory, use 'rtp' option to specify its path
6af02446233f New Vim plugin manager and its configuration should make things more portable
Steve Huston <huston@srhuston.net>
parents: 198
diff changeset
89 "Plug 'nsf/gocode', { 'rtp': 'vim' }
6af02446233f New Vim plugin manager and its configuration should make things more portable
Steve Huston <huston@srhuston.net>
parents: 198
diff changeset
90
6af02446233f New Vim plugin manager and its configuration should make things more portable
Steve Huston <huston@srhuston.net>
parents: 198
diff changeset
91 " On-demand loading: loaded when the specified command is executed
6af02446233f New Vim plugin manager and its configuration should make things more portable
Steve Huston <huston@srhuston.net>
parents: 198
diff changeset
92 "Plug 'preservim/nerdtree', { 'on': 'NERDTreeToggle' }
6af02446233f New Vim plugin manager and its configuration should make things more portable
Steve Huston <huston@srhuston.net>
parents: 198
diff changeset
93
6af02446233f New Vim plugin manager and its configuration should make things more portable
Steve Huston <huston@srhuston.net>
parents: 198
diff changeset
94 " On-demand loading: loaded when a file with a specific file type is opened
6af02446233f New Vim plugin manager and its configuration should make things more portable
Steve Huston <huston@srhuston.net>
parents: 198
diff changeset
95 "Plug 'tpope/vim-fireplace', { 'for': 'clojure' }
6af02446233f New Vim plugin manager and its configuration should make things more portable
Steve Huston <huston@srhuston.net>
parents: 198
diff changeset
96
6af02446233f New Vim plugin manager and its configuration should make things more portable
Steve Huston <huston@srhuston.net>
parents: 198
diff changeset
97 " Unmanaged plugin (manually installed and updated)
6af02446233f New Vim plugin manager and its configuration should make things more portable
Steve Huston <huston@srhuston.net>
parents: 198
diff changeset
98 "Plug '~/my-prototype-plugin'
6af02446233f New Vim plugin manager and its configuration should make things more portable
Steve Huston <huston@srhuston.net>
parents: 198
diff changeset
99
6af02446233f New Vim plugin manager and its configuration should make things more portable
Steve Huston <huston@srhuston.net>
parents: 198
diff changeset
100 " Initialize plugin system
6af02446233f New Vim plugin manager and its configuration should make things more portable
Steve Huston <huston@srhuston.net>
parents: 198
diff changeset
101 " - Automatically executes `filetype plugin indent on` and `syntax enable`.
6af02446233f New Vim plugin manager and its configuration should make things more portable
Steve Huston <huston@srhuston.net>
parents: 198
diff changeset
102 call plug#end()
6af02446233f New Vim plugin manager and its configuration should make things more portable
Steve Huston <huston@srhuston.net>
parents: 198
diff changeset
103 " You can revert the settings after the call like so:
6af02446233f New Vim plugin manager and its configuration should make things more portable
Steve Huston <huston@srhuston.net>
parents: 198
diff changeset
104 " filetype indent off " Disable file-type-specific indentation
6af02446233f New Vim plugin manager and its configuration should make things more portable
Steve Huston <huston@srhuston.net>
parents: 198
diff changeset
105 " syntax off " Disable syntax highlighting