diff --git a/docs/2023-05-03-neovim.html b/docs/2023-05-03-neovim.html index 8dbca74..9f8037c 100644 --- a/docs/2023-05-03-neovim.html +++ b/docs/2023-05-03-neovim.html @@ -156,12 +156,7 @@
vim.keymap.set("n", ";", "<Leader>", { remap = true })
 vim.keymap.set("n", "'", "<Leader>", { remap = true })
-

Misc keymap:

-
-
vim.keymap.set("n", "n", "nzz")
-vim.keymap.set("n", "N", "Nzz")
-vim.keymap.set("n", "q", ":q<CR>")
-
+

Ground rules:

-
  • - With mini-trailspace - -
  • @@ -294,17 +296,13 @@ vim.keymap.set(neovim/nvim-lspconfig + >:

  • diff --git a/docs/2023-07-30-cache-shenanigan.html b/docs/2023-07-30-cache-shenanigan.html index 2ff87ac..2dbcfed 100644 --- a/docs/2023-07-30-cache-shenanigan.html +++ b/docs/2023-07-30-cache-shenanigan.html @@ -47,34 +47,33 @@ re-write to cache -
    -
    sequenceDiagram
    -    participant other
    -    participant service
    -    participant cache
    -    participant db
    +    
    sequenceDiagram
    +    participant other
    +    participant service
    +    participant cache
    +    participant db
     
    -    other ->> service: get data
    -    activate service
    -    service ->> cache: get data
    -    alt exist in cache
    -        service -->> other: return data
    -    else not exist in cache
    -        service ->> db: get data
    -        alt exist data in db
    -            service -->> other: return data
    -        else not exist data in db
    -            service -->> other: return error not found
    -        end
    -    end
    -    deactivate service
    +    other ->> service: get data
    +    activate service
    +    service ->> cache: get data
    +    alt exist in cache
    +        service -->> other: return data
    +    else not exist in cache
    +        service ->> db: get data
    +        alt exist data in db
    +            service -->> other: return data
    +        else not exist data in db
    +            service -->> other: return error not found
    +        end
    +    end
    +    deactivate service
     
    -    other ->> service: set data
    -    activate service
    -    service ->> db: set data
    -    service ->> cache: set data
    -    deactivate service
    -
    + other ->> service: set data + activate service + service ->> db: set data + service ->> cache: set data + deactivate service +

    It's good for general cases, for example with CRUD action.

    The bad things happen when cache and database are not consistent. For diff --git a/posts/2023-05-03-neovim.md b/posts/2023-05-03-neovim.md index cd0f65a..8274c64 100644 --- a/posts/2023-05-03-neovim.md +++ b/posts/2023-05-03-neovim.md @@ -97,21 +97,21 @@ vim.keymap.set("n", ";", "", { remap = true }) vim.keymap.set("n", "'", "", { remap = true }) ``` -Misc keymap: - -```lua -vim.keymap.set("n", "n", "nzz") -vim.keymap.set("n", "N", "Nzz") -vim.keymap.set("n", "q", ":q") -``` +Ground rules: - `` prefix: prefer global keymap - `` prefix: prefer lsp keymap, for coding of course :D - With [ibhagwan/fzf-lua](https://github.com/ibhagwan/fzf-lua): - `f`: find files + - `l`: find lines - `rg`: grep files - - `s`: find lsp symbols + - With [neovim/nvim-lspconfig](https://github.com/neovim/nvim-lspconfig) + helps: + - `s`: find lsp symbols + - `d`: go to definition + - `r`: go to references + - `i`: go to implementation - With [nvim-tree/nvim-tree.lua](https://github.com/nvim-tree/nvim-tree.lua), inside nvim-tree: - ``: toggle @@ -143,17 +143,11 @@ vim.keymap.set("n", "q", ":q") - `sa`: add surround - `sd`: delete surround - `sr`: replace surround - - With mini-trailspace - - `tr`: trim trailing whitespace -- With [neovim/nvim-lspconfig](https://github.com/neovim/nvim-lspconfig) +- With [neovim/nvim-lspconfig](https://github.com/neovim/nvim-lspconfig): - `e`: float diagnostic - - `d`: go to definition - `k`: hover - ``: rename - `ca`: code action - - `r`: go to references - - `i`: go to implementation - - `f`: format ## References / Thanks