annotate .vimrc @ 33:93adaad3ca65 codex

fixing date fields when null
author Luka Sitas <sitas.luka.97@gmail.com>
date Tue, 09 Sep 2025 15:55:30 -0400
parents 827efbf4d73c
children 55d2e5c5dad9
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2
cf9993c5c7df Updated .vimrc for some helper commands.
luka
parents:
diff changeset
1 syntax on
cf9993c5c7df Updated .vimrc for some helper commands.
luka
parents:
diff changeset
2 set tabstop=2
cf9993c5c7df Updated .vimrc for some helper commands.
luka
parents:
diff changeset
3 set shiftwidth=2
cf9993c5c7df Updated .vimrc for some helper commands.
luka
parents:
diff changeset
4 set softtabstop=2
cf9993c5c7df Updated .vimrc for some helper commands.
luka
parents:
diff changeset
5 set autoindent
cf9993c5c7df Updated .vimrc for some helper commands.
luka
parents:
diff changeset
6 set smartindent
cf9993c5c7df Updated .vimrc for some helper commands.
luka
parents:
diff changeset
7 "set termguicolors
cf9993c5c7df Updated .vimrc for some helper commands.
luka
parents:
diff changeset
8 "set number
cf9993c5c7df Updated .vimrc for some helper commands.
luka
parents:
diff changeset
9 nnoremap <Leader>cc :set colorcolumn=80<cr>
cf9993c5c7df Updated .vimrc for some helper commands.
luka
parents:
diff changeset
10 nnoremap <Leader>ncc :set colorcolumn-=80<cr>
12
4bb4daa9e3f1 Working with the new FileModifier
luka
parents: 2
diff changeset
11 nnoremap <C-l> :ALECodeAction <cr>
2
cf9993c5c7df Updated .vimrc for some helper commands.
luka
parents:
diff changeset
12 set mouse=a
cf9993c5c7df Updated .vimrc for some helper commands.
luka
parents:
diff changeset
13
cf9993c5c7df Updated .vimrc for some helper commands.
luka
parents:
diff changeset
14 function! FixPhpFiles()
cf9993c5c7df Updated .vimrc for some helper commands.
luka
parents:
diff changeset
15 " Save the current cursor position
cf9993c5c7df Updated .vimrc for some helper commands.
luka
parents:
diff changeset
16 let save_cursor = getpos(".")
cf9993c5c7df Updated .vimrc for some helper commands.
luka
parents:
diff changeset
17
cf9993c5c7df Updated .vimrc for some helper commands.
luka
parents:
diff changeset
18 "Format the files
cf9993c5c7df Updated .vimrc for some helper commands.
luka
parents:
diff changeset
19 let command = 'php-cs-fixer fix .'
cf9993c5c7df Updated .vimrc for some helper commands.
luka
parents:
diff changeset
20 let output = system(command)
cf9993c5c7df Updated .vimrc for some helper commands.
luka
parents:
diff changeset
21 " Reload the file and restore the cursor position
cf9993c5c7df Updated .vimrc for some helper commands.
luka
parents:
diff changeset
22 execute 'edit!'
cf9993c5c7df Updated .vimrc for some helper commands.
luka
parents:
diff changeset
23 call setpos(".", save_cursor)
cf9993c5c7df Updated .vimrc for some helper commands.
luka
parents:
diff changeset
24 endfunction
cf9993c5c7df Updated .vimrc for some helper commands.
luka
parents:
diff changeset
25
cf9993c5c7df Updated .vimrc for some helper commands.
luka
parents:
diff changeset
26 nnoremap <leader>f :call FixPhpFiles()<CR>
cf9993c5c7df Updated .vimrc for some helper commands.
luka
parents:
diff changeset
27
cf9993c5c7df Updated .vimrc for some helper commands.
luka
parents:
diff changeset
28 " Committing commands
cf9993c5c7df Updated .vimrc for some helper commands.
luka
parents:
diff changeset
29 map <C-k> :wa<CR>:!hg addremove && hg commit <CR>
cf9993c5c7df Updated .vimrc for some helper commands.
luka
parents:
diff changeset
30
12
4bb4daa9e3f1 Working with the new FileModifier
luka
parents: 2
diff changeset
31
4bb4daa9e3f1 Working with the new FileModifier
luka
parents: 2
diff changeset
32
4bb4daa9e3f1 Working with the new FileModifier
luka
parents: 2
diff changeset
33 function! SendBufferToProgram()
4bb4daa9e3f1 Working with the new FileModifier
luka
parents: 2
diff changeset
34 " Create a temporary file
4bb4daa9e3f1 Working with the new FileModifier
luka
parents: 2
diff changeset
35 let temp_file = tempname()
4bb4daa9e3f1 Working with the new FileModifier
luka
parents: 2
diff changeset
36
4bb4daa9e3f1 Working with the new FileModifier
luka
parents: 2
diff changeset
37 " Write current buffer to the temporary file
4bb4daa9e3f1 Working with the new FileModifier
luka
parents: 2
diff changeset
38 exe "write! " . temp_file
4bb4daa9e3f1 Working with the new FileModifier
luka
parents: 2
diff changeset
39
4bb4daa9e3f1 Working with the new FileModifier
luka
parents: 2
diff changeset
40 " Send the content of the temporary file to your program
4bb4daa9e3f1 Working with the new FileModifier
luka
parents: 2
diff changeset
41 " Replace <your_program> with the actual command to run your program
4bb4daa9e3f1 Working with the new FileModifier
luka
parents: 2
diff changeset
42 let command = "cat " . temp_file . " | <your_program>"
4bb4daa9e3f1 Working with the new FileModifier
luka
parents: 2
diff changeset
43
4bb4daa9e3f1 Working with the new FileModifier
luka
parents: 2
diff changeset
44 " Execute the command
4bb4daa9e3f1 Working with the new FileModifier
luka
parents: 2
diff changeset
45 call system(command)
4bb4daa9e3f1 Working with the new FileModifier
luka
parents: 2
diff changeset
46
4bb4daa9e3f1 Working with the new FileModifier
luka
parents: 2
diff changeset
47 " Optionally, delete the temporary file if not needed
4bb4daa9e3f1 Working with the new FileModifier
luka
parents: 2
diff changeset
48 call delete(temp_file)
4bb4daa9e3f1 Working with the new FileModifier
luka
parents: 2
diff changeset
49 endfunction