Skip to content

Commit

Permalink
New plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
lvim-tech committed Sep 4, 2022
1 parent 6215e57 commit 1bf33f8
Show file tree
Hide file tree
Showing 5 changed files with 250 additions and 8 deletions.
134 changes: 134 additions & 0 deletions LVIM/modules/editor.org
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,106 @@
end
#+end_src

**  [[https://github.com/winston0410/rg.nvim][rg.nvim]]

+ INIT

#+begin_src lua
modules["winston0410/rg.nvim"] = {
event = {
"BufRead",
},
config = editor_config.rg,
}
#+end_src

+ CONFIG

#+begin_src lua
function config.rg_nvim()
local rg_status_ok, rg = pcall(require, "rg")
if not rg_status_ok then
return
end
rg.setup({
default_keybindings = {
enable = true,
modes = { "n", "v" },
binding = "te",
},
})
end
#+end_src

**  [[https://github.com/kevinhwang91/nvim-hlslens][nvim-hlslens]]

+ INIT

#+begin_src lua
modules["kevinhwang91/nvim-hlslens"] = {
event = {
"BufRead",
},
config = editor_config.nvim_hlslens,
}
#+end_src

+ CONFIG

#+begin_src lua
function config.nvim_hlslens()
local hlslens_status_ok, hlslens = pcall(require, "hlslens")
if not hlslens_status_ok then
return
end
hlslens.setup({
override_lens = function(render, posList, nearest, idx, relIdx)
local sfw = vim.v.searchforward == 1
local indicator, text, chunks
local absRelIdx = math.abs(relIdx)
if absRelIdx > 1 then
indicator = ("%d%s"):format(absRelIdx, sfw ~= (relIdx > 1) and "" or "")
elseif absRelIdx == 1 then
indicator = sfw ~= (relIdx == 1) and "" or ""
else
indicator = ""
end

local lnum, col = unpack(posList[idx])
if nearest then
local cnt = #posList
if indicator ~= "" then
text = ("[%s %d/%d]"):format(indicator, idx, cnt)
else
text = ("[%d/%d]"):format(idx, cnt)
end
chunks = { { " ", "Ignore" }, { text, "HlSearchLensNear" } }
else
text = ("[%s %d]"):format(indicator, idx)
chunks = { { " ", "Ignore" }, { text, "HlSearchLens" } }
end
render.setVirt(0, lnum - 1, col - 1, chunks, nearest)
end,
})
local kopts = { noremap = true, silent = true }
vim.api.nvim_set_keymap(
"n",
"n",
[[<Cmd>execute('normal! ' . v:count1 . 'n')<CR><Cmd>lua require('hlslens').start()<CR>]],
kopts
)
vim.api.nvim_set_keymap(
"n",
"N",
[[<Cmd>execute('normal! ' . v:count1 . 'N')<CR><Cmd>lua require('hlslens').start()<CR>]],
kopts
)
vim.api.nvim_set_keymap("n", "*", [[*<Cmd>lua require('hlslens').start()<CR>]], kopts)
vim.api.nvim_set_keymap("n", "#", [[#<Cmd>lua require('hlslens').start()<CR>]], kopts)
vim.api.nvim_set_keymap("n", "g*", [[g*<Cmd>lua require('hlslens').start()<CR>]], kopts)
vim.api.nvim_set_keymap("n", "g#", [[g#<Cmd>lua require('hlslens').start()<CR>]], kopts)
end
#+end_src
**  [[https://github.com/kevinhwang91/nvim-bqf][nvim-bqf]]

+ INIT
Expand Down Expand Up @@ -341,6 +441,40 @@
end
#+end_src

**  [[https://github.com/RRethy/nvim-treesitter-textsubjects][nvim-treesitter-textsubjects]]

+ INIT

#+begin_src lua
modules["RRethy/nvim-treesitter-textsubjects"] = {
event = {
"BufRead",
},
config = editor_config.nvim_gomove,
}
#+end_src

+ CONFIG

#+begin_src lua
function config.nvim_treesitter_textsubjects()
local nvim_treesitter_configs_status_ok, nvim_treesitter_configs = pcall(require, "nvim-treesitter.configs")
if not nvim_treesitter_configs_status_ok then
return
end
nvim_treesitter_configs.setup({
textsubjects = {
enable = true,
prev_selection = ",",
keymaps = {
["ms"] = "textsubjects-smart",
["mo"] = "textsubjects-container-outer",
["mi"] = "textsubjects-container-inner",
},
},
})
end
#+end_src
**  [[https://github.com/NTBBloodbath/rest.nvim][rest.nvim]]

+ INIT
Expand Down
4 changes: 2 additions & 2 deletions README.org
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

LVIM IDE is a modular Neovim configuration written in LUA with full customization

Current version - 2.1.25 (2022-09-03)
Current version - 2.1.30 (2022-09-04)

Startup time: 084.493 (104 plugins)
Startup time: 087.262 (107 plugins)

** SCREENSHOTS

Expand Down
14 changes: 8 additions & 6 deletions help/lvim_bindings_normal_mode.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,17 +111,19 @@ Normal mode
| -------------- | ---------------------------- | --------------------------- |
| gs | :SnipRun<CR> | Snip run |
| -------------- | ---------------------------- | --------------------------- |
| <tn> | :tabn<CR> | Tab next |
| tn | :tabn<CR> | Tab next |
| -------------- | ---------------------------- | --------------------------- |
| <tp> | :tabp<CR> | Tab prev |
| tp | :tabp<CR> | Tab prev |
| -------------- | ---------------------------- | --------------------------- |
| <tc> | :CalendarVR<CR> | Calendar |
| tc | :CalendarVR<CR> | Calendar |
| -------------- | ---------------------------- | --------------------------- |
| <to> | :e ~/Org/notes/notes.org<CR> | Open org notes |
| to | :e ~/Org/notes/notes.org<CR> | Open org notes |
| -------------- | ---------------------------- | --------------------------- |
| <th> | :Telescope howdoi<CR> | Telescope howdoi |
| th | :Telescope howdoi<CR> | Telescope howdoi |
| -------------- | ---------------------------- | --------------------------- |
| <tt> | :Telescope tmux sessions<CR> | Telescope tmux session |
| tt | :Telescope tmux sessions<CR> | Telescope tmux session |
| -------------- | ---------------------------- | --------------------------- |
| te | :Rg<CR> | Rg search under word |
| -------------- | ---------------------------- | --------------------------- |
| <A-c> | :LspLine<CR> | Lsp current line |
| -------------- | ---------------------------- | --------------------------- |
Expand Down
85 changes: 85 additions & 0 deletions lua/modules/base/configs/editor/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,73 @@ function config.telescope_nvim()
telescope.load_extension("howdoi")
end

function config.rg_nvim()
local rg_status_ok, rg = pcall(require, "rg")
if not rg_status_ok then
return
end
rg.setup({
default_keybindings = {
enable = true,
modes = { "n", "v" },
binding = "te",
},
})
end

function config.nvim_hlslens()
local hlslens_status_ok, hlslens = pcall(require, "hlslens")
if not hlslens_status_ok then
return
end
hlslens.setup({
override_lens = function(render, posList, nearest, idx, relIdx)
local sfw = vim.v.searchforward == 1
local indicator, text, chunks
local absRelIdx = math.abs(relIdx)
if absRelIdx > 1 then
indicator = ("%d%s"):format(absRelIdx, sfw ~= (relIdx > 1) and "" or "")
elseif absRelIdx == 1 then
indicator = sfw ~= (relIdx == 1) and "" or ""
else
indicator = ""
end

local lnum, col = unpack(posList[idx])
if nearest then
local cnt = #posList
if indicator ~= "" then
text = ("[%s %d/%d]"):format(indicator, idx, cnt)
else
text = ("[%d/%d]"):format(idx, cnt)
end
chunks = { { " ", "Ignore" }, { text, "HlSearchLensNear" } }
else
text = ("[%s %d]"):format(indicator, idx)
chunks = { { " ", "Ignore" }, { text, "HlSearchLens" } }
end
render.setVirt(0, lnum - 1, col - 1, chunks, nearest)
end,
})
local kopts = { noremap = true, silent = true }
vim.api.nvim_set_keymap(
"n",
"n",
[[<Cmd>execute('normal! ' . v:count1 . 'n')<CR><Cmd>lua require('hlslens').start()<CR>]],
kopts
)
vim.api.nvim_set_keymap(
"n",
"N",
[[<Cmd>execute('normal! ' . v:count1 . 'N')<CR><Cmd>lua require('hlslens').start()<CR>]],
kopts
)
vim.api.nvim_set_keymap("n", "*", [[*<Cmd>lua require('hlslens').start()<CR>]], kopts)
vim.api.nvim_set_keymap("n", "#", [[#<Cmd>lua require('hlslens').start()<CR>]], kopts)
vim.api.nvim_set_keymap("n", "g*", [[g*<Cmd>lua require('hlslens').start()<CR>]], kopts)
vim.api.nvim_set_keymap("n", "g#", [[g#<Cmd>lua require('hlslens').start()<CR>]], kopts)
end

function config.nvim_bqf()
local bqf_status_ok, bqf = pcall(require, "bqf")
if not bqf_status_ok then
Expand Down Expand Up @@ -220,6 +287,24 @@ function config.nvim_gomove()
gomove.setup()
end

function config.nvim_treesitter_textsubjects()
local nvim_treesitter_configs_status_ok, nvim_treesitter_configs = pcall(require, "nvim-treesitter.configs")
if not nvim_treesitter_configs_status_ok then
return
end
nvim_treesitter_configs.setup({
textsubjects = {
enable = true,
prev_selection = ",",
keymaps = {
["ms"] = "textsubjects-smart",
["mo"] = "textsubjects-container-outer",
["mi"] = "textsubjects-container-inner",
},
},
})
end

function config.rest_nvim()
local rest_nvim_status_ok, rest_nvim = pcall(require, "rest-nvim")
if not rest_nvim_status_ok then
Expand Down
21 changes: 21 additions & 0 deletions lua/modules/base/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,20 @@ modules["nvim-telescope/telescope.nvim"] = {
config = editor_config.telescope_nvim,
}

modules["winston0410/rg.nvim"] = {
event = {
"BufRead",
},
config = editor_config.rg,
}

modules["kevinhwang91/nvim-hlslens"] = {
event = {
"BufRead",
},
config = editor_config.nvim_hlslens,
}

modules["kevinhwang91/nvim-bqf"] = {
ft = "qf",
requires = {
Expand All @@ -183,6 +197,13 @@ modules["booperlv/nvim-gomove"] = {
config = editor_config.nvim_gomove,
}

modules["RRethy/nvim-treesitter-textsubjects"] = {
event = {
"BufRead",
},
config = editor_config.nvim_treesitter_textsubjects,
}

modules["NTBBloodbath/rest.nvim"] = {
ft = "http",
config = editor_config.rest_nvim,
Expand Down

0 comments on commit 1bf33f8

Please sign in to comment.