]> apps.delaporte.us Git - dotfiles.git/blob - files/vimrc
Add markdown live preview
[dotfiles.git] / files / vimrc
1 " -------------------------------------------------------
2 "
3 " EdTheDev's .vimrc
4 "
5 " -------------------------------------------------------
6
7 " Let the leader key be ,
8 " let mapleader=","
9
10 " Easier Ex commands
11 nnoremap ; :
12
13 " iPad and Android keyboards have no ESC Key
14 inoremap ii <esc>
15
16 set smarttab
17
18 set nocompatible " be iMproved, required
19
20 set omnifunc=syntaxcomplete#Complete
21
22 filetype off " required
23
24 " =================
25 " Install vim-plug if missing
26 " =================
27 " let data_dir = has('nvim') ? stdpath('data') . '/site' : '~/.vim'
28 " if empty(glob(data_dir . '/autoload/plug.vim'))
29 " silent execute '!curl -fLo '.data_dir.'/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
30 " autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
31 " endif
32
33 " Old Plugins
34 " -----------
35 " Distraction free writing.
36 " Plug 'junegunn/goyo.vim'
37
38
39 " Plugin 'Windows-PowerShell-Syntax-Plugin'
40
41 " PowerShell Highlighting and detection
42 " Plug 'pprovost/vim-ps1'
43
44 " Much better theme
45 " Plug NLKNguyen/papercolor-theme
46 "
47 "
48 " Plug 'fatih/vim-go', { 'do': ':GoUpdateBinaries' }
49
50 " call plug#end()
51
52 filetype plugin indent on " required for Vundle Bundle
53
54 nnoremap <leader>w :Goyo<Cr>
55
56 " If not something else, then assume Markdown
57 set filetype=markdown
58 set syntax=markdown
59
60 " Don't show tabs for HTML files. Do show trailing spaces."
61 au FileType html set nolist
62 au FileType javascript set nolist
63
64 set softtabstop=4 " makes the spaces feel like real tabs
65
66 " Sensible default for everything else.
67 set tabstop=2
68 set shiftwidth=2
69
70 " Working with Go
71 au BufNewFile,BufRead *.go set noet ts=2 sw=2 sts=2
72
73 " Working with Markdown
74
75 au BufNewFile,BufFilePre,BufRead *.md set filetype=markdown
76 colorscheme desert
77
78 " https://justinjoyce.dev/every-built-in-vim-color-scheme-with-screenshots/
79 set bg=dark
80 set number
81
82
83 " =================
84 " Plugins vim 8+
85 " =================
86 "
87 " clone into ~/.vim/pack/vendor/opt
88 " dotfiles/invoke/setup-linux has helper tasks to install
89 packadd nerdtree
90
91 " Markdown Sytax
92 packadd markdown
93 let g:vim_markdown_folding_disabled = 1
94 syntax on
95
96 " Better status line.
97 " packadd airline
98
99 " Local-only LLM support
100 " You're trying to kidnap what I've rightfully stolen.
101 " packadd vim-ollama
102 " Remember to run :Ollama pipinstall
103
104 set tabstop=2 shiftwidth=2 expandtab
105 set backupdir=~/.backup/,/tmp//
106 set directory=~/.swp
107 set undodir=~/.undo/,/tmp//
108 set backspace=indent,eol,start " Do not be pedantic about backspace.
109
110
111 " =================
112 " GitHub CoPilot
113 " =================
114
115 let g:copilot_filetypes = {
116 \ 'python': v:true,
117 \ 'markdown': v:false
118 \}
119
120 " Disable Copilot for files larger than 100kb
121 autocmd BufReadPre *
122 \ let f=getfsize(expand("<afile>"))
123 \ | if f > 100000 || f == -2
124 \ | let b:copilot_enabled = v:false
125 \ | endif
126
127