Mercurial > packages > magicforger
annotate .vimrc @ 37:116b36f5e73b ls_dev_2025_09
Adding support for tests. It's pretty basic but we can improve later.
| author | Luka Sitas <sitas.luka.97@gmail.com> |
|---|---|
| date | Thu, 25 Sep 2025 19:58:01 -0400 |
| parents | 55d2e5c5dad9 |
| children |
| rev | line source |
|---|---|
| 2 | 1 syntax on |
| 2 set tabstop=2 | |
| 3 set shiftwidth=2 | |
| 4 set softtabstop=2 | |
| 5 set autoindent | |
| 6 set smartindent | |
| 7 "set termguicolors | |
| 8 "set number | |
| 9 nnoremap <Leader>cc :set colorcolumn=80<cr> | |
| 10 nnoremap <Leader>ncc :set colorcolumn-=80<cr> | |
| 12 | 11 nnoremap <C-l> :ALECodeAction <cr> |
| 2 | 12 set mouse=a |
| 13 | |
|
35
55d2e5c5dad9
Working on the factory, it's in a semi working state but obviously not complete
Luka Sitas <sitas.luka.97@gmail.com>
parents:
23
diff
changeset
|
14 function! GeneratePhpCtags() |
|
55d2e5c5dad9
Working on the factory, it's in a semi working state but obviously not complete
Luka Sitas <sitas.luka.97@gmail.com>
parents:
23
diff
changeset
|
15 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' |
|
55d2e5c5dad9
Working on the factory, it's in a semi working state but obviously not complete
Luka Sitas <sitas.luka.97@gmail.com>
parents:
23
diff
changeset
|
16 let output = system(command) |
|
55d2e5c5dad9
Working on the factory, it's in a semi working state but obviously not complete
Luka Sitas <sitas.luka.97@gmail.com>
parents:
23
diff
changeset
|
17 endfunction |
|
55d2e5c5dad9
Working on the factory, it's in a semi working state but obviously not complete
Luka Sitas <sitas.luka.97@gmail.com>
parents:
23
diff
changeset
|
18 |
| 2 | 19 function! FixPhpFiles() |
| 20 " Save the current cursor position | |
| 21 let save_cursor = getpos(".") | |
| 22 | |
| 23 "Format the files | |
| 24 let command = 'php-cs-fixer fix .' | |
| 25 let output = system(command) | |
| 26 " Reload the file and restore the cursor position | |
| 27 execute 'edit!' | |
| 28 call setpos(".", save_cursor) | |
| 29 endfunction | |
| 30 | |
| 31 nnoremap <leader>f :call FixPhpFiles()<CR> | |
| 32 | |
| 33 " Committing commands | |
| 34 map <C-k> :wa<CR>:!hg addremove && hg commit <CR> | |
| 35 | |
| 12 | 36 |
| 37 | |
| 38 function! SendBufferToProgram() | |
| 39 " Create a temporary file | |
| 40 let temp_file = tempname() | |
| 41 | |
| 42 " Write current buffer to the temporary file | |
| 43 exe "write! " . temp_file | |
| 44 | |
| 45 " Send the content of the temporary file to your program | |
| 46 " Replace <your_program> with the actual command to run your program | |
| 47 let command = "cat " . temp_file . " | <your_program>" | |
| 48 | |
| 49 " Execute the command | |
| 50 call system(command) | |
| 51 | |
| 52 " Optionally, delete the temporary file if not needed | |
| 53 call delete(temp_file) | |
| 54 endfunction |
