Mercurial > vim
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 |
| rev | line source |
|---|---|
| 0 | 1 " Leader Mappings |
| 2 map <Space> <leader> | |
| 3 map <Leader>w :update<CR> | |
| 4 map <Leader>q :qall<CR> | |
| 5 set mouse=a | |
| 6 inoremap <C-a> <C-x><C-i> | |
| 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 | 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 | 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 | 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 | 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 | 29 |
| 30 syntax on | |
| 31 syntax enable | |
| 32 " File types | |
| 33 autocmd Filetype scss if getfsize(@%) > 300 | setlocal syntax=OFF | endif | |
| 34 highlight Comment cterm=italic gui=italic | |
| 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 | 37 |
|
7
34930197e9d4
Updating hg diff tool.
Luka Sitas <lsitas@avatarasoftware.com>
parents:
6
diff
changeset
|
38 set path+=** |
| 0 | 39 set nowrap " Dont wrap |
| 40 set backspace=indent,eol,start " http://vi.stackexchange.com/a/2163 | |
| 41 set laststatus=2 " Show status line on startup | |
| 42 set splitright " Open new splits to the right | |
| 43 set splitbelow " Open new splits to the bottom | |
| 44 set lazyredraw " Reduce the redraw frequency | |
| 45 set ttyfast " Send more characters in fast terminals | |
| 46 set nobackup nowritebackup noswapfile " Turn off backup files | |
| 47 set noerrorbells novisualbell " Turn off visual and audible bells | |
| 19 | 48 set shiftwidth=4 tabstop=4 |
| 0 | 49 set history=500 |
| 50 set hlsearch " Highlight search results | |
| 51 set ignorecase smartcase " Search queries intelligently set case | |
| 52 set incsearch " Show search results as you type | |
| 53 set timeoutlen=1000 ttimeoutlen=0 " Remove timeout when hitting escape | |
| 54 set showcmd " Show size of visual selection | |
| 55 set smartindent " Automatic formating/indenting | |
| 56 | |
| 57 " Persistent undo | |
| 58 set undodir=~/.vim/undo/ | |
| 59 set undofile | |
| 60 set undolevels=1000 | |
| 61 set undoreload=10000 | |
| 62 | |
| 63 " Tags | |
| 64 set tags=./tags,tags;$HOME | |
| 65 | |
| 66 | |
| 67 "------------------------------------------------------------------------------- | |
| 68 " Interface | |
| 69 "------------------------------------------------------------------------------- | |
| 70 | |
| 71 set number " Enable line numbers | |
| 72 set relativenumber " Enable relative line numbers | |
| 73 set scrolloff=5 " Leave 5 lines of buffer when scrolling | |
| 74 set sidescrolloff=10 " Leave 10 characters of horizontal buffer when scrolling | |
| 75 | |
| 76 | |
| 77 nnoremap <C-Left> :tabprevious<CR> | |
| 78 nnoremap <C-Right> :tabnext<CR> | |
| 79 | |
| 80 | |
| 81 | |
| 82 "------------------------------------------------------------------------------- | |
| 83 " Plugins | |
| 84 "------------------------------------------------------------------------------- | |
| 85 " Ensure that plug-vim is set up | |
| 86 let data_dir = has('nvim') ? stdpath('data') . '/site' : '~/.vim' | |
| 87 if empty(glob(data_dir . '/autoload/plug.vim')) | |
| 88 silent execute '!curl -fLo '.data_dir.'/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim' | |
| 89 autocmd VimEnter * PlugInstall --sync | source $MYVIMRC | |
| 90 endif | |
| 91 | |
| 92 call plug#begin() | |
| 93 " Environment Plugins | |
| 94 " | |
| 95 " NERDTree | |
| 11 | 96 source $HOME/.vim/plugins/nerdtree.vim |
| 0 | 97 |
| 98 " Coding and language specifics | |
| 99 " | |
| 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 | 102 |
| 103 " Blade | |
| 104 Plug 'jwalton512/vim-blade', { 'for': 'php' } | |
| 105 " Use release branch (recommended) | |
| 11 | 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 | 108 |
| 109 " AI-ify | |
| 110 Plug 'madox2/vim-ai' | |
| 111 | |
| 112 call plug#end() | |
| 113 | |
| 114 " CTRLP | |
| 11 | 115 source $HOME/.vim/plugins/ctrlp.vim |
| 0 | 116 |
| 117 " Netwr | |
| 118 set nocp | |
| 119 filetype plugin on " plugins are enabled | |
| 120 | |
| 121 | |
| 122 " Use project based .vimrc's | |
| 123 set exrc | |
| 124 | |
| 125 | |
| 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() |
