annotate .vimrc @ 4:84c75d9d90be

Changing usage to be bootstrap 5, not everything is reviewed but it's been started
author luka
date Tue, 19 Aug 2025 20:33:35 -0400
parents 07e7262a8cce
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
07e7262a8cce Initial commit for the framwork base.
luka
parents:
diff changeset
1 syntax on
07e7262a8cce Initial commit for the framwork base.
luka
parents:
diff changeset
2 set tabstop=2
07e7262a8cce Initial commit for the framwork base.
luka
parents:
diff changeset
3 set shiftwidth=2
07e7262a8cce Initial commit for the framwork base.
luka
parents:
diff changeset
4 set softtabstop=2
07e7262a8cce Initial commit for the framwork base.
luka
parents:
diff changeset
5 set autoindent
07e7262a8cce Initial commit for the framwork base.
luka
parents:
diff changeset
6 set smartindent
07e7262a8cce Initial commit for the framwork base.
luka
parents:
diff changeset
7 "set termguicolors
07e7262a8cce Initial commit for the framwork base.
luka
parents:
diff changeset
8 "set number
07e7262a8cce Initial commit for the framwork base.
luka
parents:
diff changeset
9 nnoremap <Leader>cc :set colorcolumn=80<cr>
07e7262a8cce Initial commit for the framwork base.
luka
parents:
diff changeset
10 nnoremap <Leader>ncc :set colorcolumn-=80<cr>
07e7262a8cce Initial commit for the framwork base.
luka
parents:
diff changeset
11 nnoremap <C-l> :ALECodeAction <cr>
07e7262a8cce Initial commit for the framwork base.
luka
parents:
diff changeset
12 set mouse=a
07e7262a8cce Initial commit for the framwork base.
luka
parents:
diff changeset
13
07e7262a8cce Initial commit for the framwork base.
luka
parents:
diff changeset
14 function! FixPhpFiles()
07e7262a8cce Initial commit for the framwork base.
luka
parents:
diff changeset
15 " Save the current cursor position
07e7262a8cce Initial commit for the framwork base.
luka
parents:
diff changeset
16 let save_cursor = getpos(".")
07e7262a8cce Initial commit for the framwork base.
luka
parents:
diff changeset
17
07e7262a8cce Initial commit for the framwork base.
luka
parents:
diff changeset
18 "Format the files
07e7262a8cce Initial commit for the framwork base.
luka
parents:
diff changeset
19 let command = 'php-cs-fixer fix .'
07e7262a8cce Initial commit for the framwork base.
luka
parents:
diff changeset
20 let output = system(command)
07e7262a8cce Initial commit for the framwork base.
luka
parents:
diff changeset
21 " Reload the file and restore the cursor position
07e7262a8cce Initial commit for the framwork base.
luka
parents:
diff changeset
22 execute 'edit!'
07e7262a8cce Initial commit for the framwork base.
luka
parents:
diff changeset
23 call setpos(".", save_cursor)
07e7262a8cce Initial commit for the framwork base.
luka
parents:
diff changeset
24 endfunction
07e7262a8cce Initial commit for the framwork base.
luka
parents:
diff changeset
25
07e7262a8cce Initial commit for the framwork base.
luka
parents:
diff changeset
26 nnoremap <leader>f :call FixPhpFiles()<CR>
07e7262a8cce Initial commit for the framwork base.
luka
parents:
diff changeset
27
07e7262a8cce Initial commit for the framwork base.
luka
parents:
diff changeset
28 " Committing commands
07e7262a8cce Initial commit for the framwork base.
luka
parents:
diff changeset
29 map <C-k> :wa<CR>:!hg addremove && hg commit <CR>
07e7262a8cce Initial commit for the framwork base.
luka
parents:
diff changeset
30
07e7262a8cce Initial commit for the framwork base.
luka
parents:
diff changeset
31
07e7262a8cce Initial commit for the framwork base.
luka
parents:
diff changeset
32
07e7262a8cce Initial commit for the framwork base.
luka
parents:
diff changeset
33 function! SendBufferToProgram()
07e7262a8cce Initial commit for the framwork base.
luka
parents:
diff changeset
34 " Create a temporary file
07e7262a8cce Initial commit for the framwork base.
luka
parents:
diff changeset
35 let temp_file = tempname()
07e7262a8cce Initial commit for the framwork base.
luka
parents:
diff changeset
36
07e7262a8cce Initial commit for the framwork base.
luka
parents:
diff changeset
37 " Write current buffer to the temporary file
07e7262a8cce Initial commit for the framwork base.
luka
parents:
diff changeset
38 exe "write! " . temp_file
07e7262a8cce Initial commit for the framwork base.
luka
parents:
diff changeset
39
07e7262a8cce Initial commit for the framwork base.
luka
parents:
diff changeset
40 " Send the content of the temporary file to your program
07e7262a8cce Initial commit for the framwork base.
luka
parents:
diff changeset
41 " Replace <your_program> with the actual command to run your program
07e7262a8cce Initial commit for the framwork base.
luka
parents:
diff changeset
42 let command = "cat " . temp_file . " | <your_program>"
07e7262a8cce Initial commit for the framwork base.
luka
parents:
diff changeset
43
07e7262a8cce Initial commit for the framwork base.
luka
parents:
diff changeset
44 " Execute the command
07e7262a8cce Initial commit for the framwork base.
luka
parents:
diff changeset
45 call system(command)
07e7262a8cce Initial commit for the framwork base.
luka
parents:
diff changeset
46
07e7262a8cce Initial commit for the framwork base.
luka
parents:
diff changeset
47 " Optionally, delete the temporary file if not needed
07e7262a8cce Initial commit for the framwork base.
luka
parents:
diff changeset
48 call delete(temp_file)
07e7262a8cce Initial commit for the framwork base.
luka
parents:
diff changeset
49 endfunction