Skip to content

Commit

Permalink
add cheatsheet
Browse files Browse the repository at this point in the history
  • Loading branch information
Hyuga-Tsukui committed Apr 2, 2024
1 parent 1f6824e commit a49d20b
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
15 changes: 15 additions & 0 deletions dot_config/nvim/cheatsheet.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Cheatseets.

### vimgrep

https://qiita.com/yuku_t/items/0c1aff03949cb1b8fe6b

-- basic useage.
vim {pattern} file

-- grep current dir.
vim {pattern} **

-- integreted quickfix.
vim {pattern} % | cw

8 changes: 8 additions & 0 deletions dot_config/nvim/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,18 @@ if not vim.g.vscode then
opt.clipboard:append("unnamedplus")
opt.relativenumber = true

function Open_cheatsheet()
local che = vim.fn.stdpath("config") .. "/cheatsheet.md"
vim.cmd("split " .. che)
vim.cmd("setlocal readonly")
vim.cmd("resize 10")
end

-- keymaps.
vim.keymap.set("n", "<C-j>", ":bprev<CR>", { noremap = true, silent = true })
vim.keymap.set("n", "<C-k>", ":bnext<CR>", { noremap = true, silent = true })
vim.keymap.set("n", "<C-p>", ":FzfLua files<CR>", { noremap = true })
vim.keymap.set("n", "<leader>cs", "<cmd>lua Open_cheatsheet()<CR>", { noremap = true, silent = true })

local undodir = vim.fn.stdpath("config") .. "/undo"
if vim.fn.isdirectory(undodir) == 0 then
Expand Down

0 comments on commit a49d20b

Please sign in to comment.