diff options
| -rw-r--r-- | alias | 3 | ||||
| -rwxr-xr-x | profile.sh | 3 | ||||
| -rw-r--r-- | snippets/html_leaflet | 9 | ||||
| -rw-r--r-- | snippets/html_maplibre_cdn | 1 | ||||
| -rw-r--r-- | snippets/javascript_promise | 3 | ||||
| -rw-r--r-- | snippets/javascript_terrdraw | 32 | ||||
| -rw-r--r-- | tigrc | 12 | ||||
| -rw-r--r-- | vim/init.vim | 2 | ||||
| -rw-r--r-- | vim/init/config.vim | 4 | ||||
| -rw-r--r-- | vim/init/keymaps.vim | 8 | ||||
| -rw-r--r-- | vim/mini.lua | 70 |
11 files changed, 104 insertions, 43 deletions
| @@ -207,7 +207,7 @@ date.reset() { | |||
| 207 | alias clock.reset='hwclock --systohc' | 207 | alias clock.reset='hwclock --systohc' |
| 208 | unalias gr &>/dev/null | 208 | unalias gr &>/dev/null |
| 209 | gr() { | 209 | gr() { |
| 210 | grep -IR $1 . | 210 | grep -IR $@ . --exclude-dir=node_modules |
| 211 | } | 211 | } |
| 212 | alias findn='find . -iname' | 212 | alias findn='find . -iname' |
| 213 | 213 | ||
| @@ -537,6 +537,7 @@ alias ffmpeg='ffmpeg -hide_banner' | |||
| 537 | alias md='reveal' | 537 | alias md='reveal' |
| 538 | alias terminal.color='printf "\e[%dm%d dark\e[0m \e[%d;1m%d bold\e[0m\n" {30..37}{,,,}' | 538 | alias terminal.color='printf "\e[%dm%d dark\e[0m \e[%d;1m%d bold\e[0m\n" {30..37}{,,,}' |
| 539 | alias gpg.bye='gpg-connect-agent reloadagent /bye' | 539 | alias gpg.bye='gpg-connect-agent reloadagent /bye' |
| 540 | alias npm='pnpm' | ||
| 540 | 541 | ||
| 541 | # GIS | 542 | # GIS |
| 542 | TAIWAN_BBOX='118.1036,20.72799,122.9312,26.60305' | 543 | TAIWAN_BBOX='118.1036,20.72799,122.9312,26.60305' |
| @@ -73,6 +73,7 @@ fi | |||
| 73 | [ -e $HOME/.config/nvm/nvm.sh ] && source "$HOME/.config/nvm/nvm.sh" | 73 | [ -e $HOME/.config/nvm/nvm.sh ] && source "$HOME/.config/nvm/nvm.sh" |
| 74 | 74 | ||
| 75 | # Working DIR | 75 | # Working DIR |
| 76 | [[ `pwd` == $HOME ]] && test -d ~/Downloads && cd ~/Downloads | 76 | # [[ `pwd` == $HOME ]] && test -d ~/Downloads && cd ~/Downloads |
| 77 | cd ~/git/dumbymap | ||
| 77 | 78 | ||
| 78 | true | 79 | true |
diff --git a/snippets/html_leaflet b/snippets/html_leaflet new file mode 100644 index 0000000..7b434c1 --- /dev/null +++ b/snippets/html_leaflet | |||
| @@ -0,0 +1,9 @@ | |||
| 1 | <link rel="stylesheet" href="https://unpkg.com/leaflet@1.9.4/dist/leaflet.css" | ||
| 2 | integrity="sha256-p4NxAoJBhIIN+hmNHrzRCf9tD/miZyoHS5obTRR9BMY=" | ||
| 3 | crossorigin=""/> | ||
| 4 | <!-- Make sure you put this AFTER Leaflet's CSS --> | ||
| 5 | <script src="https://unpkg.com/leaflet@1.9.4/dist/leaflet.js" | ||
| 6 | integrity="sha256-20nQCchB9co0qIjJZRGuk2/Z9VM+kNiyxNV1lvTlZBo=" | ||
| 7 | crossorigin=""></script> | ||
| 8 | |||
| 9 | |||
diff --git a/snippets/html_maplibre_cdn b/snippets/html_maplibre_cdn new file mode 100644 index 0000000..4dc2b17 --- /dev/null +++ b/snippets/html_maplibre_cdn | |||
| @@ -0,0 +1 @@ | |||
| <script src='https://unpkg.com/maplibre-gl@4.6.0/dist/maplibre-gl.js'></script> | |||
diff --git a/snippets/javascript_promise b/snippets/javascript_promise new file mode 100644 index 0000000..12128a7 --- /dev/null +++ b/snippets/javascript_promise | |||
| @@ -0,0 +1,3 @@ | |||
| 1 | new Promise((resolve, reject) => { | ||
| 2 | |||
| 3 | }) | ||
diff --git a/snippets/javascript_terrdraw b/snippets/javascript_terrdraw new file mode 100644 index 0000000..17363b1 --- /dev/null +++ b/snippets/javascript_terrdraw | |||
| @@ -0,0 +1,32 @@ | |||
| 1 | // Events | ||
| 2 | draw.on("finish", (id: string, context: { action: string, mode: string }) => { | ||
| 3 | if (action === 'draw') { | ||
| 4 | // Do something for draw finish event | ||
| 5 | } else if (action === 'dragFeature') { | ||
| 6 | // Do something for a drag finish event | ||
| 7 | } else if (action === 'dragCoordinate') { | ||
| 8 | // | ||
| 9 | }else if (action === 'dragCoordinateResize') { | ||
| 10 | // | ||
| 11 | } | ||
| 12 | }); | ||
| 13 | |||
| 14 | draw.on("change", (ids: string[], type: string) => { | ||
| 15 | // Possible type values: | ||
| 16 | // 'create' | ||
| 17 | // 'update' | ||
| 18 | // 'delete' | ||
| 19 | // 'styling' | ||
| 20 | // Do something | ||
| 21 | //... | ||
| 22 | }); | ||
| 23 | |||
| 24 | draw.on("select", (id: string) => { | ||
| 25 | // Do something | ||
| 26 | //... | ||
| 27 | }); | ||
| 28 | |||
| 29 | draw.on("deselect", () => { | ||
| 30 | // Do something | ||
| 31 | //... | ||
| 32 | }); | ||
| @@ -39,12 +39,12 @@ bind generic xB +sh -c "echo -n %(blob) | xsel -ib && echo Full Blob Clipped" | |||
| 39 | ## Remote | 39 | ## Remote |
| 40 | bind generic Uv +sh -c "git remote -v | grep %(remote)" | 40 | bind generic Uv +sh -c "git remote -v | grep %(remote)" |
| 41 | bind generic UV >sh -c "git remote -vv | tig" | 41 | bind generic UV >sh -c "git remote -vv | tig" |
| 42 | bind generic Ua @git remote add "%(prompt New Github remote name: )" git@github.com:"%(prompt User/Repo: )" | 42 | bind generic UA @git remote add "%(prompt New Github remote name: )" git@github.com:"%(prompt User/Repo: )" |
| 43 | bind generic UA @git remote add "%(prompt New remote name: )" "%(prompt Remote url: )" | 43 | bind generic Ua @git remote add "%(prompt New remote name: )" "%(prompt Remote url: )" |
| 44 | bind generic Ur @git remote rename "%(prompt Rename which remote?: )" "%(prompt Enter new remote name: )" | 44 | bind generic Ur @git remote rename "%(prompt Rename which remote?: )" "%(prompt Enter new remote name: )" |
| 45 | bind generic U! @git remote remove "%(prompt Remove which remote?: )" | 45 | bind generic U! @git remote remove "%(prompt Remove which remote?: )" |
| 46 | bind generic Us @git remote set-url "%(prompt Set url for which remote?: )" git@github.com:"%(prompt User/Repo: )" | 46 | bind generic US @git remote set-url "%(prompt Set url for which remote?: )" git@github.com:"%(prompt User/Repo: )" |
| 47 | bind generic US @git remote set-url "%(prompt Set url for which remote?: )" "%(prompt New url: )" | 47 | bind generic Us @git remote set-url "%(prompt Set url for which remote?: )" "%(prompt New url: )" |
| 48 | bind generic Uf ?git fetch "%(prompt Fetch from which remote?: )" | 48 | bind generic Uf ?git fetch "%(prompt Fetch from which remote?: )" |
| 49 | bind generic UU ?git remote update --prune | 49 | bind generic UU ?git remote update --prune |
| 50 | bind generic Ut ?sh -c "git pull %(remote) --tags --force" | 50 | bind generic Ut ?sh -c "git pull %(remote) --tags --force" |
| @@ -140,9 +140,9 @@ bind main gs ?@git merge %(branch) --squash | |||
| 140 | bind main p none # override default pager binding | 140 | bind main p none # override default pager binding |
| 141 | bind main pp ?git push | 141 | bind main pp ?git push |
| 142 | bind main pP ?git push -u %(remote) %(branch):%(branch) | 142 | bind main pP ?git push -u %(remote) %(branch):%(branch) |
| 143 | bind main pr ?git push -u %(remote) %(branch):%(branch) | 143 | bind main pR ?git push -u %(remote) %(branch):%(branch) |
| 144 | bind main pc ?git push -u %(remote) %(commit):%(branch) | 144 | bind main pc ?git push -u %(remote) %(commit):%(branch) |
| 145 | bind main pR ?git push -u '%(prompt Which remote? )' %(branch):%(branch) | 145 | bind main pr ?git push -u '%(prompt Which remote? )' %(branch):%(branch) |
| 146 | bind main pF ?git push --force | 146 | bind main pF ?git push --force |
| 147 | bind main pd ?git push %(remote) :%(branch) | 147 | bind main pd ?git push %(remote) :%(branch) |
| 148 | bind generic pD ?git push '%(prompt Delete from which remote? )' :'%(prompt Which reference? )' | 148 | bind generic pD ?git push '%(prompt Delete from which remote? )' :'%(prompt Which reference? )' |
diff --git a/vim/init.vim b/vim/init.vim index c1dee81..59be77e 100644 --- a/vim/init.vim +++ b/vim/init.vim | |||
| @@ -30,3 +30,5 @@ else | |||
| 30 | endif | 30 | endif |
| 31 | 31 | ||
| 32 | LoadScript init/highlight.vim | 32 | LoadScript init/highlight.vim |
| 33 | |||
| 34 | source ~/.projects.vim | ||
diff --git a/vim/init/config.vim b/vim/init/config.vim index 74cbd39..4676942 100644 --- a/vim/init/config.vim +++ b/vim/init/config.vim | |||
| @@ -188,11 +188,13 @@ augroup InitFileTypes | |||
| 188 | endif | 188 | endif |
| 189 | 189 | ||
| 190 | " Fold for heading and the following contents | 190 | " Fold for heading and the following contents |
| 191 | let hash_num = matchstr(getline(v:lnum), '^#\+') | 191 | let hash_num = matchstr(getline(v:lnum), '^\zs#\+\ze\s') |
| 192 | if !empty(hash_num) | 192 | if !empty(hash_num) |
| 193 | let foldlevel = g:markdown_apply_heading_level ? len(hash_num) - 1 : 1 | 193 | let foldlevel = g:markdown_apply_heading_level ? len(hash_num) - 1 : 1 |
| 194 | " HEADING | 194 | " HEADING |
| 195 | return len(hash_num) == 1 ? 0 : '>'.foldlevel | 195 | return len(hash_num) == 1 ? 0 : '>'.foldlevel |
| 196 | elseif match(getline(v:lnum), '^----') != -1 | ||
| 197 | return "<" | ||
| 196 | else | 198 | else |
| 197 | " Contents | 199 | " Contents |
| 198 | return "=" | 200 | return "=" |
diff --git a/vim/init/keymaps.vim b/vim/init/keymaps.vim index c0af8c8..bf3d7ab 100644 --- a/vim/init/keymaps.vim +++ b/vim/init/keymaps.vim | |||
| @@ -92,6 +92,11 @@ nnoremap gF :e <cfile><CR> | |||
| 92 | xnoremap iq i" | 92 | xnoremap iq i" |
| 93 | xnoremap aq a" | 93 | xnoremap aq a" |
| 94 | 94 | ||
| 95 | nnoremap ze zszH | ||
| 96 | |||
| 97 | nnoremap 0 ^ | ||
| 98 | nnoremap ^ 0 | ||
| 99 | |||
| 95 | 100 | ||
| 96 | " READLINE {{{ | 101 | " READLINE {{{ |
| 97 | 102 | ||
| @@ -495,8 +500,9 @@ function! CloseBufferSafely() | |||
| 495 | tabclose | 500 | tabclose |
| 496 | else | 501 | else |
| 497 | " Switch to proper buffer | 502 | " Switch to proper buffer |
| 498 | let next_buf = get(t:bufs, bufnr('#')) ? bufnr('#') : filter(t:bufs, 'v:val != '..bufnr)[0] | 503 | let next_buf = get(t:bufs, bufnr('#')) ? bufnr('#') : filter(t:bufs, 'v:val != '..bufnr)[-1] |
| 499 | exe "b "..next_buf | 504 | exe "b "..next_buf |
| 505 | " exe "buffer ".g:lastbuffer | ||
| 500 | call filter(t:bufs, 'v:val != '..bufnr) | 506 | call filter(t:bufs, 'v:val != '..bufnr) |
| 501 | endif | 507 | endif |
| 502 | 508 | ||
diff --git a/vim/mini.lua b/vim/mini.lua index 92f9efe..0658d4d 100644 --- a/vim/mini.lua +++ b/vim/mini.lua | |||
| @@ -1412,39 +1412,43 @@ require("lazy").setup({ | |||
| 1412 | }, | 1412 | }, |
| 1413 | 1413 | ||
| 1414 | -- }}} | 1414 | -- }}} |
| 1415 | -- -- lspsaga {{{ | 1415 | -- lspsaga {{{ |
| 1416 | -- { | 1416 | { |
| 1417 | -- 'nvimdev/lspsaga.nvim', | 1417 | 'nvimdev/lspsaga.nvim', |
| 1418 | -- dependencies = { | 1418 | dependencies = { |
| 1419 | -- 'nvim-treesitter/nvim-treesitter', -- optional | 1419 | 'nvim-treesitter/nvim-treesitter', -- optional |
| 1420 | -- 'nvim-tree/nvim-web-devicons', -- optional | 1420 | 'nvim-tree/nvim-web-devicons', -- optional |
| 1421 | -- }, | 1421 | }, |
| 1422 | -- config = function() | 1422 | config = function() |
| 1423 | -- require('lspsaga').setup({ | 1423 | require('lspsaga').setup({ |
| 1424 | -- autochdir = true, | 1424 | autochdir = true, |
| 1425 | -- }) | 1425 | lightbulb = { |
| 1426 | -- vim.api.nvim_create_autocmd("LspAttach", { | 1426 | sign = false, |
| 1427 | -- group = custom_autocommands, | 1427 | virtual_text = true, |
| 1428 | -- pattern = "*", | 1428 | }, |
| 1429 | -- callback = function(args) | 1429 | }) |
| 1430 | -- local map = vim.api.nvim_buf_set_keymap | 1430 | vim.api.nvim_create_autocmd("LspAttach", { |
| 1431 | -- map(0, "n", "gd", "<cmd>Lspsaga goto_definition<cr>", { silent = true, noremap = true }) | 1431 | group = custom_autocommands, |
| 1432 | -- map(0, "n", "gR", "<cmd>Lspsaga rename<cr>", { silent = true, noremap = true }) | 1432 | pattern = "*", |
| 1433 | -- map(0, "n", "gx", "<cmd>Lspsaga code_action<cr>", { silent = true, noremap = true }) | 1433 | callback = function(args) |
| 1434 | -- map(0, "x", "gx", ":<c-u>Lspsaga range_code_action<cr>", { silent = true, noremap = true }) | 1434 | local map = vim.api.nvim_buf_set_keymap |
| 1435 | -- map(0, "n", "K", "<cmd>Lspsaga hover_doc<cr>", { silent = true, noremap = true }) | 1435 | map(0, "n", "gd", "<cmd>Lspsaga goto_definition<cr>", { silent = true, noremap = true }) |
| 1436 | -- map(0, "n", "go", "<cmd>Lspsaga show_line_diagnostics<cr>", { silent = true, noremap = true }) | 1436 | map(0, "n", "gR", "<cmd>Lspsaga rename<cr>", { silent = true, noremap = true }) |
| 1437 | -- map(0, "n", "gj", "<cmd>Lspsaga diagnostic_jump_next<cr>", { silent = true, noremap = true }) | 1437 | map(0, "n", "gx", "<cmd>Lspsaga code_action<cr>", { silent = true, noremap = true }) |
| 1438 | -- map(0, "n", "gk", "<cmd>Lspsaga diagnostic_jump_prev<cr>", { silent = true, noremap = true }) | 1438 | map(0, "x", "gx", ":<c-u>Lspsaga range_code_action<cr>", { silent = true, noremap = true }) |
| 1439 | -- | 1439 | map(0, "n", "K", "<cmd>Lspsaga hover_doc<cr>", { silent = true, noremap = true }) |
| 1440 | -- -- Don't know why... Everytime when modeline is set and insert a single char | 1440 | map(0, "n", "go", "<cmd>Lspsaga show_line_diagnostics<cr>", { silent = true, noremap = true }) |
| 1441 | -- -- while inside a fold, the fold closes. | 1441 | map(0, "n", "gj", "<cmd>Lspsaga diagnostic_jump_next<cr>", { silent = true, noremap = true }) |
| 1442 | -- vim.opt_local.modeline = false | 1442 | map(0, "n", "gk", "<cmd>Lspsaga diagnostic_jump_prev<cr>", { silent = true, noremap = true }) |
| 1443 | -- end, | 1443 | |
| 1444 | -- }) | 1444 | -- Don't know why... Everytime when modeline is set and insert a single char |
| 1445 | -- end | 1445 | -- while inside a fold, the fold closes. |
| 1446 | -- }, | 1446 | vim.opt_local.modeline = false |
| 1447 | -- -- }}} | 1447 | end, |
| 1448 | }) | ||
| 1449 | end | ||
| 1450 | }, | ||
| 1451 | -- }}} | ||
| 1448 | -- -- conform {{{ | 1452 | -- -- conform {{{ |
| 1449 | -- { | 1453 | -- { |
| 1450 | -- "stevearc/conform.nvim", | 1454 | -- "stevearc/conform.nvim", |