aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--alias3
-rwxr-xr-xprofile.sh3
-rw-r--r--snippets/html_leaflet9
-rw-r--r--snippets/html_maplibre_cdn1
-rw-r--r--snippets/javascript_promise3
-rw-r--r--snippets/javascript_terrdraw32
-rw-r--r--tigrc12
-rw-r--r--vim/init.vim2
-rw-r--r--vim/init/config.vim4
-rw-r--r--vim/init/keymaps.vim8
-rw-r--r--vim/mini.lua70
11 files changed, 104 insertions, 43 deletions
diff --git a/alias b/alias
index 5af2f78..1d9ff8d 100644
--- a/alias
+++ b/alias
@@ -207,7 +207,7 @@ date.reset() {
207alias clock.reset='hwclock --systohc' 207alias clock.reset='hwclock --systohc'
208unalias gr &>/dev/null 208unalias gr &>/dev/null
209gr() { 209gr() {
210 grep -IR $1 . 210 grep -IR $@ . --exclude-dir=node_modules
211} 211}
212alias findn='find . -iname' 212alias findn='find . -iname'
213 213
@@ -537,6 +537,7 @@ alias ffmpeg='ffmpeg -hide_banner'
537alias md='reveal' 537alias md='reveal'
538alias terminal.color='printf "\e[%dm%d dark\e[0m \e[%d;1m%d bold\e[0m\n" {30..37}{,,,}' 538alias terminal.color='printf "\e[%dm%d dark\e[0m \e[%d;1m%d bold\e[0m\n" {30..37}{,,,}'
539alias gpg.bye='gpg-connect-agent reloadagent /bye' 539alias gpg.bye='gpg-connect-agent reloadagent /bye'
540alias npm='pnpm'
540 541
541# GIS 542# GIS
542TAIWAN_BBOX='118.1036,20.72799,122.9312,26.60305' 543TAIWAN_BBOX='118.1036,20.72799,122.9312,26.60305'
diff --git a/profile.sh b/profile.sh
index 9ebe755..3b32d55 100755
--- a/profile.sh
+++ b/profile.sh
@@ -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
77cd ~/git/dumbymap
77 78
78true 79true
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 @@
1new 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
2draw.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
14draw.on("change", (ids: string[], type: string) => {
15 // Possible type values:
16 // 'create'
17 // 'update'
18 // 'delete'
19 // 'styling'
20 // Do something
21 //...
22});
23
24draw.on("select", (id: string) => {
25 // Do something
26 //...
27});
28
29draw.on("deselect", () => {
30 // Do something
31 //...
32});
diff --git a/tigrc b/tigrc
index 02330a6..8817f54 100644
--- a/tigrc
+++ b/tigrc
@@ -39,12 +39,12 @@ bind generic xB +sh -c "echo -n %(blob) | xsel -ib && echo Full Blob Clipped"
39## Remote 39## Remote
40bind generic Uv +sh -c "git remote -v | grep %(remote)" 40bind generic Uv +sh -c "git remote -v | grep %(remote)"
41bind generic UV >sh -c "git remote -vv | tig" 41bind generic UV >sh -c "git remote -vv | tig"
42bind generic Ua @git remote add "%(prompt New Github remote name: )" git@github.com:"%(prompt User/Repo: )" 42bind generic UA @git remote add "%(prompt New Github remote name: )" git@github.com:"%(prompt User/Repo: )"
43bind generic UA @git remote add "%(prompt New remote name: )" "%(prompt Remote url: )" 43bind generic Ua @git remote add "%(prompt New remote name: )" "%(prompt Remote url: )"
44bind generic Ur @git remote rename "%(prompt Rename which remote?: )" "%(prompt Enter new remote name: )" 44bind generic Ur @git remote rename "%(prompt Rename which remote?: )" "%(prompt Enter new remote name: )"
45bind generic U! @git remote remove "%(prompt Remove which remote?: )" 45bind generic U! @git remote remove "%(prompt Remove which remote?: )"
46bind generic Us @git remote set-url "%(prompt Set url for which remote?: )" git@github.com:"%(prompt User/Repo: )" 46bind generic US @git remote set-url "%(prompt Set url for which remote?: )" git@github.com:"%(prompt User/Repo: )"
47bind generic US @git remote set-url "%(prompt Set url for which remote?: )" "%(prompt New url: )" 47bind generic Us @git remote set-url "%(prompt Set url for which remote?: )" "%(prompt New url: )"
48bind generic Uf ?git fetch "%(prompt Fetch from which remote?: )" 48bind generic Uf ?git fetch "%(prompt Fetch from which remote?: )"
49bind generic UU ?git remote update --prune 49bind generic UU ?git remote update --prune
50bind generic Ut ?sh -c "git pull %(remote) --tags --force" 50bind generic Ut ?sh -c "git pull %(remote) --tags --force"
@@ -140,9 +140,9 @@ bind main gs ?@git merge %(branch) --squash
140bind main p none # override default pager binding 140bind main p none # override default pager binding
141bind main pp ?git push 141bind main pp ?git push
142bind main pP ?git push -u %(remote) %(branch):%(branch) 142bind main pP ?git push -u %(remote) %(branch):%(branch)
143bind main pr ?git push -u %(remote) %(branch):%(branch) 143bind main pR ?git push -u %(remote) %(branch):%(branch)
144bind main pc ?git push -u %(remote) %(commit):%(branch) 144bind main pc ?git push -u %(remote) %(commit):%(branch)
145bind main pR ?git push -u '%(prompt Which remote? )' %(branch):%(branch) 145bind main pr ?git push -u '%(prompt Which remote? )' %(branch):%(branch)
146bind main pF ?git push --force 146bind main pF ?git push --force
147bind main pd ?git push %(remote) :%(branch) 147bind main pd ?git push %(remote) :%(branch)
148bind generic pD ?git push '%(prompt Delete from which remote? )' :'%(prompt Which reference? )' 148bind 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
30endif 30endif
31 31
32LoadScript init/highlight.vim 32LoadScript init/highlight.vim
33
34source ~/.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>
92xnoremap iq i" 92xnoremap iq i"
93xnoremap aq a" 93xnoremap aq a"
94 94
95nnoremap ze zszH
96
97nnoremap 0 ^
98nnoremap ^ 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",