annotate .vimrc @ 20:7cc13548becc

updating coc, prompts and auto loggin
author Luka Sitas <lsitas@avatarasoftware.com>
date Thu, 26 Feb 2026 12:30:11 -0500
parents 1c8e1cdb35f7
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
a4ec03f77554 I don't know...
luka
parents:
diff changeset
1 " Leader Mappings
a4ec03f77554 I don't know...
luka
parents:
diff changeset
2 map <Space> <leader>
a4ec03f77554 I don't know...
luka
parents:
diff changeset
3 map <Leader>w :update<CR>
a4ec03f77554 I don't know...
luka
parents:
diff changeset
4 map <Leader>q :qall<CR>
a4ec03f77554 I don't know...
luka
parents:
diff changeset
5 set mouse=a
a4ec03f77554 I don't know...
luka
parents:
diff changeset
6 inoremap <C-a> <C-x><C-i>
a4ec03f77554 I don't know...
luka
parents:
diff changeset
7
9
17c557de03e0 Updated commit window
Luka Sitas <lsitas@avatarasoftware.com>
parents: 7
diff changeset
8 colorscheme desert
17c557de03e0 Updated commit window
Luka Sitas <lsitas@avatarasoftware.com>
parents: 7
diff changeset
9
0
a4ec03f77554 I don't know...
luka
parents:
diff changeset
10 " Support for tags closing and classes
17
412c33afd395 Update for core and some minor fixes
Luka Sitas <lsitas@avatarasoftware.com>
parents: 16
diff changeset
11 source $HOME/.vim/plugins/core/core.vim
10
b95a8e2525cc Better vim-ai support for local model on edit
Luka Sitas <lsitas@avatarasoftware.com>
parents: 9
diff changeset
12 source $HOME/.vim/plugins/vim-ai.vim
11
eeda6b1401ae changing files to .vim
luka
parents: 7
diff changeset
13 source $HOME/.vim/plugins/taghelp.vim
5
4a7bc1c8551b support for params in queries
Luka Sitas <lsitas@avatarasoftware.com>
parents: 4
diff changeset
14 source $HOME/.vim/plugins/dbtables/dbtables.vim
6
3017fd33ad8b Better support for db tables.
Luka Sitas <lsitas@avatarasoftware.com>
parents: 5
diff changeset
15 source $HOME/.vim/plugins/hghelp/hghelp.vim
7
34930197e9d4 Updating hg diff tool.
Luka Sitas <lsitas@avatarasoftware.com>
parents: 6
diff changeset
16 source $HOME/.vim/plugins/globalsearch.vim
18
203279635445 Adding in the voice note ability. It's not perfect but it is working.
Luka Sitas <lsitas@avatarasoftware.com>
parents: 17
diff changeset
17 source $HOME/.vim/plugins/voicenote/voicenote.vim
7
34930197e9d4 Updating hg diff tool.
Luka Sitas <lsitas@avatarasoftware.com>
parents: 6
diff changeset
18
0
a4ec03f77554 I don't know...
luka
parents:
diff changeset
19
6
3017fd33ad8b Better support for db tables.
Luka Sitas <lsitas@avatarasoftware.com>
parents: 5
diff changeset
20 let g:db_user = "" " Replace with your default database username
3017fd33ad8b Better support for db tables.
Luka Sitas <lsitas@avatarasoftware.com>
parents: 5
diff changeset
21 let g:db_password = "" " Replace with your default database password
3017fd33ad8b Better support for db tables.
Luka Sitas <lsitas@avatarasoftware.com>
parents: 5
diff changeset
22 let g:db_name = "" " Replace with your default database name
3017fd33ad8b Better support for db tables.
Luka Sitas <lsitas@avatarasoftware.com>
parents: 5
diff changeset
23 let g:db_host = "" " Replace with your default database name
1
47fe251d5ce0 minor fixes for hotkeys
luka
parents: 0
diff changeset
24
9
17c557de03e0 Updated commit window
Luka Sitas <lsitas@avatarasoftware.com>
parents: 7
diff changeset
25 function! GeneratePhpCtags()
17c557de03e0 Updated commit window
Luka Sitas <lsitas@avatarasoftware.com>
parents: 7
diff changeset
26 let command = 'ctags -R --fields=+aimS --php-kinds=cdfint --languages=php --extras=+q --tag-relative=yes --exclude=".git" --exclude=".hg" --exclude="node_modules" --exclude="composer.phar" --totals=yes'
17c557de03e0 Updated commit window
Luka Sitas <lsitas@avatarasoftware.com>
parents: 7
diff changeset
27 let output = system(command)
17c557de03e0 Updated commit window
Luka Sitas <lsitas@avatarasoftware.com>
parents: 7
diff changeset
28 endfunction
0
a4ec03f77554 I don't know...
luka
parents:
diff changeset
29
a4ec03f77554 I don't know...
luka
parents:
diff changeset
30 syntax on
a4ec03f77554 I don't know...
luka
parents:
diff changeset
31 syntax enable
a4ec03f77554 I don't know...
luka
parents:
diff changeset
32 " File types
a4ec03f77554 I don't know...
luka
parents:
diff changeset
33 autocmd Filetype scss if getfsize(@%) > 300 | setlocal syntax=OFF | endif
a4ec03f77554 I don't know...
luka
parents:
diff changeset
34 highlight Comment cterm=italic gui=italic
a4ec03f77554 I don't know...
luka
parents:
diff changeset
35 autocmd FileType *.blade.php setlocal commentstring=#\ %s
20
7cc13548becc updating coc, prompts and auto loggin
Luka Sitas <lsitas@avatarasoftware.com>
parents: 19
diff changeset
36 autocmd BufNewFile,BufRead *.php set iskeyword+=$
0
a4ec03f77554 I don't know...
luka
parents:
diff changeset
37
7
34930197e9d4 Updating hg diff tool.
Luka Sitas <lsitas@avatarasoftware.com>
parents: 6
diff changeset
38 set path+=**
0
a4ec03f77554 I don't know...
luka
parents:
diff changeset
39 set nowrap " Dont wrap
a4ec03f77554 I don't know...
luka
parents:
diff changeset
40 set backspace=indent,eol,start " http://vi.stackexchange.com/a/2163
a4ec03f77554 I don't know...
luka
parents:
diff changeset
41 set laststatus=2 " Show status line on startup
a4ec03f77554 I don't know...
luka
parents:
diff changeset
42 set splitright " Open new splits to the right
a4ec03f77554 I don't know...
luka
parents:
diff changeset
43 set splitbelow " Open new splits to the bottom
a4ec03f77554 I don't know...
luka
parents:
diff changeset
44 set lazyredraw " Reduce the redraw frequency
a4ec03f77554 I don't know...
luka
parents:
diff changeset
45 set ttyfast " Send more characters in fast terminals
a4ec03f77554 I don't know...
luka
parents:
diff changeset
46 set nobackup nowritebackup noswapfile " Turn off backup files
a4ec03f77554 I don't know...
luka
parents:
diff changeset
47 set noerrorbells novisualbell " Turn off visual and audible bells
19
1c8e1cdb35f7 updating tab space
Luka Sitas <lsitas@avatarasoftware.com>
parents: 18
diff changeset
48 set shiftwidth=4 tabstop=4
0
a4ec03f77554 I don't know...
luka
parents:
diff changeset
49 set history=500
a4ec03f77554 I don't know...
luka
parents:
diff changeset
50 set hlsearch " Highlight search results
a4ec03f77554 I don't know...
luka
parents:
diff changeset
51 set ignorecase smartcase " Search queries intelligently set case
a4ec03f77554 I don't know...
luka
parents:
diff changeset
52 set incsearch " Show search results as you type
a4ec03f77554 I don't know...
luka
parents:
diff changeset
53 set timeoutlen=1000 ttimeoutlen=0 " Remove timeout when hitting escape
a4ec03f77554 I don't know...
luka
parents:
diff changeset
54 set showcmd " Show size of visual selection
a4ec03f77554 I don't know...
luka
parents:
diff changeset
55 set smartindent " Automatic formating/indenting
a4ec03f77554 I don't know...
luka
parents:
diff changeset
56
a4ec03f77554 I don't know...
luka
parents:
diff changeset
57 " Persistent undo
a4ec03f77554 I don't know...
luka
parents:
diff changeset
58 set undodir=~/.vim/undo/
a4ec03f77554 I don't know...
luka
parents:
diff changeset
59 set undofile
a4ec03f77554 I don't know...
luka
parents:
diff changeset
60 set undolevels=1000
a4ec03f77554 I don't know...
luka
parents:
diff changeset
61 set undoreload=10000
a4ec03f77554 I don't know...
luka
parents:
diff changeset
62
a4ec03f77554 I don't know...
luka
parents:
diff changeset
63 " Tags
a4ec03f77554 I don't know...
luka
parents:
diff changeset
64 set tags=./tags,tags;$HOME
a4ec03f77554 I don't know...
luka
parents:
diff changeset
65
a4ec03f77554 I don't know...
luka
parents:
diff changeset
66
a4ec03f77554 I don't know...
luka
parents:
diff changeset
67 "-------------------------------------------------------------------------------
a4ec03f77554 I don't know...
luka
parents:
diff changeset
68 " Interface
a4ec03f77554 I don't know...
luka
parents:
diff changeset
69 "-------------------------------------------------------------------------------
a4ec03f77554 I don't know...
luka
parents:
diff changeset
70
a4ec03f77554 I don't know...
luka
parents:
diff changeset
71 set number " Enable line numbers
a4ec03f77554 I don't know...
luka
parents:
diff changeset
72 set relativenumber " Enable relative line numbers
a4ec03f77554 I don't know...
luka
parents:
diff changeset
73 set scrolloff=5 " Leave 5 lines of buffer when scrolling
a4ec03f77554 I don't know...
luka
parents:
diff changeset
74 set sidescrolloff=10 " Leave 10 characters of horizontal buffer when scrolling
a4ec03f77554 I don't know...
luka
parents:
diff changeset
75
a4ec03f77554 I don't know...
luka
parents:
diff changeset
76
a4ec03f77554 I don't know...
luka
parents:
diff changeset
77 nnoremap <C-Left> :tabprevious<CR>
a4ec03f77554 I don't know...
luka
parents:
diff changeset
78 nnoremap <C-Right> :tabnext<CR>
a4ec03f77554 I don't know...
luka
parents:
diff changeset
79
a4ec03f77554 I don't know...
luka
parents:
diff changeset
80
a4ec03f77554 I don't know...
luka
parents:
diff changeset
81
a4ec03f77554 I don't know...
luka
parents:
diff changeset
82 "-------------------------------------------------------------------------------
a4ec03f77554 I don't know...
luka
parents:
diff changeset
83 " Plugins
a4ec03f77554 I don't know...
luka
parents:
diff changeset
84 "-------------------------------------------------------------------------------
a4ec03f77554 I don't know...
luka
parents:
diff changeset
85 " Ensure that plug-vim is set up
a4ec03f77554 I don't know...
luka
parents:
diff changeset
86 let data_dir = has('nvim') ? stdpath('data') . '/site' : '~/.vim'
a4ec03f77554 I don't know...
luka
parents:
diff changeset
87 if empty(glob(data_dir . '/autoload/plug.vim'))
a4ec03f77554 I don't know...
luka
parents:
diff changeset
88 silent execute '!curl -fLo '.data_dir.'/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
a4ec03f77554 I don't know...
luka
parents:
diff changeset
89 autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
a4ec03f77554 I don't know...
luka
parents:
diff changeset
90 endif
a4ec03f77554 I don't know...
luka
parents:
diff changeset
91
a4ec03f77554 I don't know...
luka
parents:
diff changeset
92 call plug#begin()
a4ec03f77554 I don't know...
luka
parents:
diff changeset
93 " Environment Plugins
a4ec03f77554 I don't know...
luka
parents:
diff changeset
94 "
a4ec03f77554 I don't know...
luka
parents:
diff changeset
95 " NERDTree
11
eeda6b1401ae changing files to .vim
luka
parents: 7
diff changeset
96 source $HOME/.vim/plugins/nerdtree.vim
0
a4ec03f77554 I don't know...
luka
parents:
diff changeset
97
a4ec03f77554 I don't know...
luka
parents:
diff changeset
98 " Coding and language specifics
a4ec03f77554 I don't know...
luka
parents:
diff changeset
99 "
a4ec03f77554 I don't know...
luka
parents:
diff changeset
100 " LSP - ale
20
7cc13548becc updating coc, prompts and auto loggin
Luka Sitas <lsitas@avatarasoftware.com>
parents: 19
diff changeset
101 " source $HOME/.vim/plugins/ale.vim
0
a4ec03f77554 I don't know...
luka
parents:
diff changeset
102
a4ec03f77554 I don't know...
luka
parents:
diff changeset
103 " Blade
a4ec03f77554 I don't know...
luka
parents:
diff changeset
104 Plug 'jwalton512/vim-blade', { 'for': 'php' }
a4ec03f77554 I don't know...
luka
parents:
diff changeset
105 " Use release branch (recommended)
11
eeda6b1401ae changing files to .vim
luka
parents: 7
diff changeset
106 source $HOME/.vim/plugins/coc.vim
20
7cc13548becc updating coc, prompts and auto loggin
Luka Sitas <lsitas@avatarasoftware.com>
parents: 19
diff changeset
107 Plug 'phpactor/phpactor', {'for': 'php', 'tag': '*', 'do': 'composer install --no-dev -o'}" Plug 'preservim/tagbar'
0
a4ec03f77554 I don't know...
luka
parents:
diff changeset
108
a4ec03f77554 I don't know...
luka
parents:
diff changeset
109 " AI-ify
a4ec03f77554 I don't know...
luka
parents:
diff changeset
110 Plug 'madox2/vim-ai'
a4ec03f77554 I don't know...
luka
parents:
diff changeset
111
a4ec03f77554 I don't know...
luka
parents:
diff changeset
112 call plug#end()
a4ec03f77554 I don't know...
luka
parents:
diff changeset
113
a4ec03f77554 I don't know...
luka
parents:
diff changeset
114 " CTRLP
11
eeda6b1401ae changing files to .vim
luka
parents: 7
diff changeset
115 source $HOME/.vim/plugins/ctrlp.vim
0
a4ec03f77554 I don't know...
luka
parents:
diff changeset
116
a4ec03f77554 I don't know...
luka
parents:
diff changeset
117 " Netwr
a4ec03f77554 I don't know...
luka
parents:
diff changeset
118 set nocp
a4ec03f77554 I don't know...
luka
parents:
diff changeset
119 filetype plugin on " plugins are enabled
a4ec03f77554 I don't know...
luka
parents:
diff changeset
120
a4ec03f77554 I don't know...
luka
parents:
diff changeset
121
a4ec03f77554 I don't know...
luka
parents:
diff changeset
122 " Use project based .vimrc's
a4ec03f77554 I don't know...
luka
parents:
diff changeset
123 set exrc
a4ec03f77554 I don't know...
luka
parents:
diff changeset
124
a4ec03f77554 I don't know...
luka
parents:
diff changeset
125
a4ec03f77554 I don't know...
luka
parents:
diff changeset
126 " Get some better php support for ale see https://github.com/dense-analysis/ale/blob/master/supported-tools.md
20
7cc13548becc updating coc, prompts and auto loggin
Luka Sitas <lsitas@avatarasoftware.com>
parents: 19
diff changeset
127
7cc13548becc updating coc, prompts and auto loggin
Luka Sitas <lsitas@avatarasoftware.com>
parents: 19
diff changeset
128
7cc13548becc updating coc, prompts and auto loggin
Luka Sitas <lsitas@avatarasoftware.com>
parents: 19
diff changeset
129
7cc13548becc updating coc, prompts and auto loggin
Luka Sitas <lsitas@avatarasoftware.com>
parents: 19
diff changeset
130 " Log current working directory with timestamp to a cache file
7cc13548becc updating coc, prompts and auto loggin
Luka Sitas <lsitas@avatarasoftware.com>
parents: 19
diff changeset
131 function! LogCwdToCache()
7cc13548becc updating coc, prompts and auto loggin
Luka Sitas <lsitas@avatarasoftware.com>
parents: 19
diff changeset
132 " Path to your cache file (change if you want)
7cc13548becc updating coc, prompts and auto loggin
Luka Sitas <lsitas@avatarasoftware.com>
parents: 19
diff changeset
133 let l:cachefile = expand('~/.vim_cwd_cache')
7cc13548becc updating coc, prompts and auto loggin
Luka Sitas <lsitas@avatarasoftware.com>
parents: 19
diff changeset
134
7cc13548becc updating coc, prompts and auto loggin
Luka Sitas <lsitas@avatarasoftware.com>
parents: 19
diff changeset
135 " Get timestamp and current working directory
7cc13548becc updating coc, prompts and auto loggin
Luka Sitas <lsitas@avatarasoftware.com>
parents: 19
diff changeset
136 let l:timestamp = strftime('%Y-%m-%d %H:%M:%S')
7cc13548becc updating coc, prompts and auto loggin
Luka Sitas <lsitas@avatarasoftware.com>
parents: 19
diff changeset
137 let l:cwd = getcwd()
7cc13548becc updating coc, prompts and auto loggin
Luka Sitas <lsitas@avatarasoftware.com>
parents: 19
diff changeset
138
7cc13548becc updating coc, prompts and auto loggin
Luka Sitas <lsitas@avatarasoftware.com>
parents: 19
diff changeset
139 " Append line: "YYYY-MM-DD HH:MM:SS /path/to/dir"
7cc13548becc updating coc, prompts and auto loggin
Luka Sitas <lsitas@avatarasoftware.com>
parents: 19
diff changeset
140 call writefile([l:timestamp . ' ' . l:cwd], l:cachefile, 'a')
7cc13548becc updating coc, prompts and auto loggin
Luka Sitas <lsitas@avatarasoftware.com>
parents: 19
diff changeset
141 endfunction
7cc13548becc updating coc, prompts and auto loggin
Luka Sitas <lsitas@avatarasoftware.com>
parents: 19
diff changeset
142
7cc13548becc updating coc, prompts and auto loggin
Luka Sitas <lsitas@avatarasoftware.com>
parents: 19
diff changeset
143 " Example mappings/commands to trigger it:
7cc13548becc updating coc, prompts and auto loggin
Luka Sitas <lsitas@avatarasoftware.com>
parents: 19
diff changeset
144 " Call manually:
7cc13548becc updating coc, prompts and auto loggin
Luka Sitas <lsitas@avatarasoftware.com>
parents: 19
diff changeset
145 command! LogCwd call LogCwdToCache()
7cc13548becc updating coc, prompts and auto loggin
Luka Sitas <lsitas@avatarasoftware.com>
parents: 19
diff changeset
146
7cc13548becc updating coc, prompts and auto loggin
Luka Sitas <lsitas@avatarasoftware.com>
parents: 19
diff changeset
147 " Or log automatically on VimEnter:
7cc13548becc updating coc, prompts and auto loggin
Luka Sitas <lsitas@avatarasoftware.com>
parents: 19
diff changeset
148 autocmd VimEnter * call LogCwdToCache()