diff options
-rw-r--r-- | X11/openbox/rc.xml | 7 | ||||
-rw-r--r-- | alias | 16 | ||||
-rw-r--r-- | gitconfig | 1 | ||||
-rw-r--r-- | snippets/javascript_mutationoberserver | 26 | ||||
-rw-r--r-- | vim/init.vim | 3 | ||||
-rw-r--r-- | vim/init/basic.vim | 2 | ||||
-rw-r--r-- | vim/init/config.vim | 45 | ||||
-rw-r--r-- | vim/mini.lua | 79 | ||||
-rw-r--r-- | vim/spell/en.utf-8.add | 24 | ||||
-rw-r--r-- | vim/spell/en.utf-8.add.spl | bin | 307 -> 932 bytes |
10 files changed, 127 insertions, 76 deletions
diff --git a/X11/openbox/rc.xml b/X11/openbox/rc.xml index 2626285..b1736b8 100644 --- a/X11/openbox/rc.xml +++ b/X11/openbox/rc.xml | |||
@@ -541,7 +541,7 @@ | |||
541 | <keybind key="W-e"> | 541 | <keybind key="W-e"> |
542 | <action name="Execute"> | 542 | <action name="Execute"> |
543 | <command> | 543 | <command> |
544 | alacritty -e nvim -c 'r !xsel -ob' -c 'normal A' -c 'startinsert' -c 'nmap <C-c> :w !xsel -ib<CR>:qa!<CR>' | 544 | alacritty -o 'env.fullrc="false"' -e nvim -c 'r !xsel -ob' -c 'normal A' -c 'startinsert' -c 'nmap <C-c> :w !xsel -ib<CR>:qa!<CR>' |
545 | </command> | 545 | </command> |
546 | </action> | 546 | </action> |
547 | </keybind> | 547 | </keybind> |
@@ -575,10 +575,7 @@ | |||
575 | <keybind key="W-y"> | 575 | <keybind key="W-y"> |
576 | <action name="Execute"> | 576 | <action name="Execute"> |
577 | <command> | 577 | <command> |
578 | sh -c ' | 578 | sh -c 'yad --entry | xargs -i xdotool set_window --name @{} `xdotool getactivewindow`' |
579 | zenity --entry --text "Window title" | \ | ||
580 | xargs -i xdotool set_window --name @{} `xdotool getactivewindow` | ||
581 | ' | ||
582 | </command> | 579 | </command> |
583 | </action> | 580 | </action> |
584 | </keybind> | 581 | </keybind> |
@@ -22,16 +22,16 @@ eval "${shell}rc(){ | |||
22 | }" | 22 | }" |
23 | alias vimrc='vim ~/.vimrc' | 23 | alias vimrc='vim ~/.vimrc' |
24 | alias tigrc="$EDITOR ~/.tigrc" | 24 | alias tigrc="$EDITOR ~/.tigrc" |
25 | alias muttrc="$EDITOR ~/.config/mutt/muttrc" | 25 | alias mutt.rc="$EDITOR ~/.config/mutt/muttrc" |
26 | alias alarc="$EDITOR ~/.config/alacritty/alacritty.toml" | 26 | alias ala.rc="$EDITOR ~/.config/alacritty/alacritty.toml" |
27 | alias alacritty.rc="$EDITOR ~/.config/alacritty/alacritty.toml" | 27 | alias alacritty.rc="$EDITOR ~/.config/alacritty/alacritty.toml" |
28 | alias gitconfig="$EDITOR ~/.gitconfig" | 28 | alias git.config="$EDITOR ~/.gitconfig" |
29 | alias gpgconfig="$EDITOR ~/.gnupg/gpg-agent.conf" | 29 | alias gpg.config="$EDITOR ~/.gnupg/gpg-agent.conf" |
30 | alias sshconfig="$EDITOR ~/.ssh/config" | 30 | alias ssh.config="$EDITOR ~/.ssh/config" |
31 | alias sshauth="$EDITOR ~/.ssh/authorized_keys" | 31 | alias ssh.auth="$EDITOR ~/.ssh/authorized_keys" |
32 | alias sshknown="$EDITOR ~/.ssh/known_hosts" | 32 | alias ssh.known="$EDITOR ~/.ssh/known_hosts" |
33 | config(){ cd ~/.config/$1; } | 33 | config(){ cd ~/.config/$1; } |
34 | alias tmuxconfig="$EDITOR ~/.tmux.conf" | 34 | alias tmux.config="$EDITOR ~/.tmux.conf" |
35 | cde() { cd /etc/$@; } | 35 | cde() { cd /etc/$@; } |
36 | 36 | ||
37 | alias cdetc='cde' | 37 | alias cdetc='cde' |
@@ -20,6 +20,7 @@ | |||
20 | git stash show -p | git apply -R && \ | 20 | git stash show -p | git apply -R && \ |
21 | git stash drop stash@{1} | 21 | git stash drop stash@{1} |
22 | swapprotocol = !swap-protocol.bash | 22 | swapprotocol = !swap-protocol.bash |
23 | mergethis = "!f() { git commit-tree HEAD: -p $1 -p HEAD -m \"Merge branch $(git branch --show-current)\" | xargs git branch --force $1; }; f" | ||
23 | 24 | ||
24 | [merge] | 25 | [merge] |
25 | tool = vimdiff | 26 | tool = vimdiff |
diff --git a/snippets/javascript_mutationoberserver b/snippets/javascript_mutationoberserver index 48f17af..9962aac 100644 --- a/snippets/javascript_mutationoberserver +++ b/snippets/javascript_mutationoberserver | |||
@@ -1,12 +1,14 @@ | |||
1 | new window.MutationObserver((ms) => { | 1 | new window.MutationObserver((mutations) => { |
2 | for (const m of ms) { | 2 | for (const mutation of mutations) { |
3 | console.log(m) | 3 | console.log(mutation) |
4 | console.log('m', m.target.innerHTML) | 4 | console.log('mutation', mutation.target.innerHTML) |
5 | console.log('m', m.target.classList) | 5 | console.log('mutation', mutation.target.classList) |
6 | } | 6 | } |
7 | }).observe(item, { | 7 | }).observe(item, { |
8 | attributes: true, | 8 | attributes: true, |
9 | attributeFilter: ['class'], | 9 | attributeFilter: ['class'], |
10 | attributeOldValue: true, | 10 | attributeOldValue: true, |
11 | characterDataOldValue: true | 11 | characterDataOldValue: true, |
12 | }) | 12 | childList: true, |
13 | subtree: true, | ||
14 | }) | ||
diff --git a/vim/init.vim b/vim/init.vim index 8ac92e0..aed0c41 100644 --- a/vim/init.vim +++ b/vim/init.vim | |||
@@ -15,6 +15,9 @@ execute 'set runtimepath+='.s:home | |||
15 | " Load scripts in home | 15 | " Load scripts in home |
16 | command! -nargs=1 LoadScript exec 'source '.s:home.'/'.'<args>' | 16 | command! -nargs=1 LoadScript exec 'source '.s:home.'/'.'<args>' |
17 | 17 | ||
18 | if $fullrc == 'false' | ||
19 | finish | ||
20 | endif | ||
18 | 21 | ||
19 | " Gerneral scripts | 22 | " Gerneral scripts |
20 | LoadScript init/basic.vim " Basic configuration | 23 | LoadScript init/basic.vim " Basic configuration |
diff --git a/vim/init/basic.vim b/vim/init/basic.vim index c4c62e7..4a49f39 100644 --- a/vim/init/basic.vim +++ b/vim/init/basic.vim | |||
@@ -119,7 +119,7 @@ set errorformat+=[%f:%l]\ ->\ %m,[%f:%l]:%m | |||
119 | set splitright | 119 | set splitright |
120 | 120 | ||
121 | " Set signcolumn | 121 | " Set signcolumn |
122 | set signcolumn="yes:3" | 122 | set signcolumn=yes:3 |
123 | " Custom sign from help page :h sign | 123 | " Custom sign from help page :h sign |
124 | sign define piet text=>> texthl=Search | 124 | sign define piet text=>> texthl=Search |
125 | 125 | ||
diff --git a/vim/init/config.vim b/vim/init/config.vim index 5c53728..ce81f8a 100644 --- a/vim/init/config.vim +++ b/vim/init/config.vim | |||
@@ -221,26 +221,47 @@ augroup InitFileTypes | |||
221 | au FileType javascript call InitJavascriptFile() | 221 | au FileType javascript call InitJavascriptFile() |
222 | function! InitJavascriptFile() | 222 | function! InitJavascriptFile() |
223 | setlocal wrap sw=2 ts=2 | 223 | setlocal wrap sw=2 ts=2 |
224 | 224 | setlocal foldexpr=JsdocLevel() foldmethod=expr foldtext=JSdocFoldText() | |
225 | setlocal foldexpr=JsdocLevel() foldmethod=expr | ||
226 | |||
227 | let l:jsdocPrefix = "JSDOC: " | ||
228 | setlocal foldtext=JSdocFoldText() | ||
229 | endfunc | 225 | endfunc |
230 | 226 | ||
231 | function! JsdocLevel() | 227 | function! JsdocLevel() |
232 | let jsdoc = matchstr(getline(v:lnum), '^\zs\s*\/\*\*\ze') | 228 | let line = getline(v:lnum) |
229 | let jsdoc = matchstr(line, '^\zs[ \/]*\/\*\*\ze') | ||
230 | let indent = len(matchstr(line, '^\zs\s*\ze')) / 2 | ||
231 | |||
233 | if !empty(jsdoc) | 232 | if !empty(jsdoc) |
234 | let foldlevel = len(matchstr(jsdoc, '^\zs\s*\ze')) + 1 | 233 | let foldlevel = indent + 1 |
235 | return '>'.foldlevel | 234 | return '>'.foldlevel |
236 | else | 235 | else |
237 | " Contents | 236 | let foldlevel = foldlevel(v:lnum - 1) |
238 | return "=" | 237 | " let lastIndent = len(matchstr(getline(v:lnum - 1), '^\zs\s*\ze')) / 2 |
238 | " let pattern = matchstr(line, '^\s*\zs[})]\+;*\ze$') | ||
239 | " if !empty(line) && len(pattern) > 0 && indent + 1 == foldlevel && indent < lastIndent | ||
240 | " return "<".foldlevel | ||
241 | if empty(line) && empty(getline(v:lnum - 1)) | ||
242 | return "<".foldlevel | ||
243 | else | ||
244 | return "=" | ||
245 | endif | ||
239 | endif | 246 | endif |
240 | endfunc | 247 | endfunc |
241 | 248 | ||
242 | function! JSdocFoldText() | 249 | function! JSdocFoldText() |
243 | return "JSDOC: ".matchstr(getline(v:foldstart + 1), '^[\* ]*\zs.*\ze') | 250 | let line = getline(v:foldstart) |
251 | let message = matchstr(line, '\*\s\zs.*\ze\s\*\+/$') | ||
252 | let lines = v:foldend - v:foldstart | ||
253 | |||
254 | if empty(message) | ||
255 | let line = getline(v:foldstart + 1) | ||
256 | let message = "@ ".matchstr(line, '^[\* ]*\zs.*\ze') | ||
257 | endif | ||
258 | |||
259 | let comment = matchstr(line, '^\s*\zs//\ze') | ||
260 | if !empty(comment) | ||
261 | let message = '/** '.message.' */' | ||
262 | endif | ||
263 | |||
264 | return repeat(" ", v:foldlevel - 1).repeat(" ", 4 - len(lines)).lines." lines -- ".message | ||
244 | endfunc | 265 | endfunc |
245 | 266 | ||
246 | " }}} | 267 | " }}} |
@@ -265,8 +286,8 @@ augroup InitFileTypes | |||
265 | endfunc | 286 | endfunc |
266 | autocmd FileType html,markdown,javascript nnoremap <buffer> <leader>cl :call <SID>ChangeAttr("class")<CR> | 287 | autocmd FileType html,markdown,javascript nnoremap <buffer> <leader>cl :call <SID>ChangeAttr("class")<CR> |
267 | autocmd FileType html,markdown,javascript nnoremap <buffer> <leader>id :call <SID>ChangeAttr("id")<CR> | 288 | autocmd FileType html,markdown,javascript nnoremap <buffer> <leader>id :call <SID>ChangeAttr("id")<CR> |
268 | autocmd FileType css,javascript nnoremap <buffer> <F9> :let LINE=line(".")<CR>:silent! %!npx standard --stdin --fix 2>/dev/null<CR>:exe LINE<CR> | 289 | autocmd FileType css,javascript nnoremap <buffer> <F9> :let LINE=line(".")<CR>:silent! %!standard --stdin --fix 2>/dev/null<CR>:exe LINE<CR> |
269 | autocmd FileType css,javascript nmap <buffer> <F8> cdg:let LINE=line(".")<CR>:%!stylelint --fix --stdin 2>/dev/null<CR>:exe LINE<CR> | 290 | autocmd FileType css,javascript nmap <buffer> <F8> cdg:let LINE=line(".")<CR>:%!stylelint -c scripts/stylelintrc.json --fix --stdin 2>/dev/null<CR>:exe LINE<CR> |
270 | autocmd FileType css,javascript set formatprg=prettier | 291 | autocmd FileType css,javascript set formatprg=prettier |
271 | 292 | ||
272 | " Reload preview server | 293 | " Reload preview server |
diff --git a/vim/mini.lua b/vim/mini.lua index 7451258..6c81d8f 100644 --- a/vim/mini.lua +++ b/vim/mini.lua | |||
@@ -1420,43 +1420,43 @@ require("lazy").setup({ | |||
1420 | }, | 1420 | }, |
1421 | 1421 | ||
1422 | -- }}} | 1422 | -- }}} |
1423 | -- lspsaga {{{ | 1423 | -- -- lspsaga {{{ |
1424 | { | 1424 | -- { |
1425 | 'nvimdev/lspsaga.nvim', | 1425 | -- 'nvimdev/lspsaga.nvim', |
1426 | dependencies = { | 1426 | -- dependencies = { |
1427 | 'nvim-treesitter/nvim-treesitter', -- optional | 1427 | -- 'nvim-treesitter/nvim-treesitter', -- optional |
1428 | 'nvim-tree/nvim-web-devicons', -- optional | 1428 | -- 'nvim-tree/nvim-web-devicons', -- optional |
1429 | }, | 1429 | -- }, |
1430 | config = function() | 1430 | -- config = function() |
1431 | require('lspsaga').setup({ | 1431 | -- require('lspsaga').setup({ |
1432 | autochdir = true, | 1432 | -- autochdir = true, |
1433 | lightbulb = { | 1433 | -- lightbulb = { |
1434 | sign = false, | 1434 | -- sign = false, |
1435 | virtual_text = true, | 1435 | -- virtual_text = true, |
1436 | }, | 1436 | -- }, |
1437 | }) | 1437 | -- }) |
1438 | vim.api.nvim_create_autocmd("LspAttach", { | 1438 | -- vim.api.nvim_create_autocmd("LspAttach", { |
1439 | group = custom_autocommands, | 1439 | -- group = custom_autocommands, |
1440 | pattern = "*", | 1440 | -- pattern = "*", |
1441 | callback = function(args) | 1441 | -- callback = function(args) |
1442 | local map = vim.api.nvim_buf_set_keymap | 1442 | -- local map = vim.api.nvim_buf_set_keymap |
1443 | map(0, "n", "gd", "<cmd>Lspsaga goto_definition<cr>", { silent = true, noremap = true }) | 1443 | -- map(0, "n", "gd", "<cmd>Lspsaga goto_definition<cr>", { silent = true, noremap = true }) |
1444 | map(0, "n", "gR", "<cmd>Lspsaga rename<cr>", { silent = true, noremap = true }) | 1444 | -- map(0, "n", "gR", "<cmd>Lspsaga rename<cr>", { silent = true, noremap = true }) |
1445 | map(0, "n", "gx", "<cmd>Lspsaga code_action<cr>", { silent = true, noremap = true }) | 1445 | -- map(0, "n", "gx", "<cmd>Lspsaga code_action<cr>", { silent = true, noremap = true }) |
1446 | map(0, "x", "gx", ":<c-u>Lspsaga range_code_action<cr>", { silent = true, noremap = true }) | 1446 | -- map(0, "x", "gx", ":<c-u>Lspsaga range_code_action<cr>", { silent = true, noremap = true }) |
1447 | map(0, "n", "K", "<cmd>Lspsaga hover_doc<cr>", { silent = true, noremap = true }) | 1447 | -- map(0, "n", "K", "<cmd>Lspsaga hover_doc<cr>", { silent = true, noremap = true }) |
1448 | map(0, "n", "go", "<cmd>Lspsaga show_line_diagnostics<cr>", { silent = true, noremap = true }) | 1448 | -- map(0, "n", "go", "<cmd>Lspsaga show_line_diagnostics<cr>", { silent = true, noremap = true }) |
1449 | map(0, "n", "gj", "<cmd>Lspsaga diagnostic_jump_next<cr>", { silent = true, noremap = true }) | 1449 | -- map(0, "n", "gj", "<cmd>Lspsaga diagnostic_jump_next<cr>", { silent = true, noremap = true }) |
1450 | map(0, "n", "gk", "<cmd>Lspsaga diagnostic_jump_prev<cr>", { silent = true, noremap = true }) | 1450 | -- map(0, "n", "gk", "<cmd>Lspsaga diagnostic_jump_prev<cr>", { silent = true, noremap = true }) |
1451 | 1451 | -- | |
1452 | -- Don't know why... Everytime when modeline is set and insert a single char | 1452 | -- -- Don't know why... Everytime when modeline is set and insert a single char |
1453 | -- while inside a fold, the fold closes. | 1453 | -- -- while inside a fold, the fold closes. |
1454 | vim.opt_local.modeline = false | 1454 | -- vim.opt_local.modeline = false |
1455 | end, | 1455 | -- end, |
1456 | }) | 1456 | -- }) |
1457 | end | 1457 | -- end |
1458 | }, | 1458 | -- }, |
1459 | -- }}} | 1459 | -- -- }}} |
1460 | -- -- conform {{{ | 1460 | -- -- conform {{{ |
1461 | -- { | 1461 | -- { |
1462 | -- "stevearc/conform.nvim", | 1462 | -- "stevearc/conform.nvim", |
@@ -1488,9 +1488,12 @@ require("lazy").setup({ | |||
1488 | g.ale_ruby_rubocop_auto_correct_all = 1 | 1488 | g.ale_ruby_rubocop_auto_correct_all = 1 |
1489 | 1489 | ||
1490 | g.ale_linters = { | 1490 | g.ale_linters = { |
1491 | ruby = { 'javascript', 'standard' }, | 1491 | javascript = { 'javascript', 'standard' }, |
1492 | lua = { 'lua_language_server' } | 1492 | lua = { 'lua_language_server' } |
1493 | } | 1493 | } |
1494 | g.ale_fixers = {javascript = {'standard'}} | ||
1495 | g.ale_lint_on_save = 1 | ||
1496 | g.ale_fix_on_save = 1 | ||
1494 | 1497 | ||
1495 | vim.keymap.set("n", "\a", vim.cmd("ALEDisable")) | 1498 | vim.keymap.set("n", "\a", vim.cmd("ALEDisable")) |
1496 | end | 1499 | end |
diff --git a/vim/spell/en.utf-8.add b/vim/spell/en.utf-8.add index d4297c4..a943ffe 100644 --- a/vim/spell/en.utf-8.add +++ b/vim/spell/en.utf-8.add | |||
@@ -14,3 +14,27 @@ mjs | |||
14 | DocLink | 14 | DocLink |
15 | StoryMapJS | 15 | StoryMapJS |
16 | afterMapRendered | 16 | afterMapRendered |
17 | DumbyMap | ||
18 | YAML | ||
19 | param | ||
20 | anchorName | ||
21 | CodeMirror | ||
22 | RefLink | ||
23 | refLink | ||
24 | getRefLinks | ||
25 | refLinks | ||
26 | initialValue | ||
27 | MarkdownIt | ||
28 | linkify | ||
29 | GeoLinks | ||
30 | li | ||
31 | HTMLElement | ||
32 | crs | ||
33 | EPSG | ||
34 | ESRI | ||
35 | epsg | ||
36 | io | ||
37 | mdContent | ||
38 | updateAttributeByStep | ||
39 | MutationObserver | ||
40 | mapCallback | ||
diff --git a/vim/spell/en.utf-8.add.spl b/vim/spell/en.utf-8.add.spl index a9f1927..afae2c5 100644 --- a/vim/spell/en.utf-8.add.spl +++ b/vim/spell/en.utf-8.add.spl | |||
Binary files differ | |||