Skip to content
This repository has been archived by the owner on Apr 16, 2024. It is now read-only.

Autocompletion for commandline(:) and search #424

Open
wants to merge 74 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
5c9059c
fix: neotree not display dir with "git" in name
tuanbass Oct 28, 2022
e76b7e0
feat: add some user modules
tuanbass Oct 28, 2022
fa9098a
feat: change user config
tuanbass Oct 28, 2022
e50649e
feat: add some user modules
tuanbass Nov 4, 2022
155a4a1
feat: add some todo notes
tuanbass Nov 4, 2022
abd8157
feat: add some user config
tuanbass Nov 4, 2022
7a40c10
feat: enable indentlines automatically, not when change colorscheme
tuanbass Nov 4, 2022
e4e6283
feat: add some git shortcut
tuanbass Nov 4, 2022
fb5d3a0
fix: nvim-tree broken when lsp disabled
tuanbass Nov 16, 2022
54a1c4d
fix: nvim-tree broken when lsp disabled
tuanbass Nov 16, 2022
0bd3c7c
feat: add fold module
tuanbass Nov 18, 2022
b900966
Minor (non important) changes
tuanbass Nov 18, 2022
bd8d30a
Change modules config
tuanbass Nov 18, 2022
9daabd7
feat(scope): Add Module for source code navigation
tuanbass Dec 7, 2022
3705275
Add module for windows and view
tuanbass Dec 7, 2022
eaeeca9
add module for reactoring features
tuanbass Dec 7, 2022
277916d
Add a template file to start a module
tuanbass Dec 7, 2022
4a3978e
Add custom config
tuanbass Dec 7, 2022
0c1fff6
fix(explorer): wrong call back for gitignore
tuanbass Dec 14, 2022
344d1c6
feat(buf): Add behavior and command to close buffer
tuanbass Dec 20, 2022
c9b18b9
fix(explorer): wrong call back for gitignore
tuanbass Dec 14, 2022
c3a3f91
Change settings for user modules
tuanbass Feb 1, 2023
b347a94
change formater for typescript to prettierd
tuanbass Feb 1, 2023
88e204d
change docs: update todo notes
tuanbass Feb 1, 2023
c102c61
use fzf-native for fuzzy for telescope
tuanbass Feb 1, 2023
668f0c8
Change formater and lsp for markdown
tuanbass Feb 2, 2023
4ab841d
fix: remove print command
tuanbass Feb 2, 2023
363e17a
fix: typescript formatter
tuanbass Feb 2, 2023
67430f6
add scratch module
tuanbass Feb 2, 2023
b72134e
Merge branch 'main' into tuanbass from upstream
tuanbass Feb 2, 2023
c12aa0a
Add configuration for completion on searc and cmdline
tuanbass Feb 2, 2023
5d5b50d
Merge branch 'release' into develop
tuanbass Feb 2, 2023
990a818
Add configuration for completion on searc and cmdline
tuanbass Feb 2, 2023
b3f9523
update status of Daniel plugin
tuanbass Feb 3, 2023
3be7135
Add telescope ui select
tuanbass Feb 3, 2023
69e212d
change modules config:
tuanbass Feb 3, 2023
b36e886
fix: Telescope projects not work (randomly)
tuanbass Feb 3, 2023
05080e7
feat: enable projects
tuanbass Feb 3, 2023
244e5c3
Update status daniel
tuanbass Feb 7, 2023
685b86c
enable autosession
tuanbass Feb 7, 2023
cc4657d
initialize entertainment feature
tuanbass Feb 7, 2023
ba63dc4
Remove sample charcounter
tuanbass Feb 8, 2023
06f2c60
Show all file in nvimtree
tuanbass Feb 9, 2023
4fc78d1
avoid open telescope find_files in some buffer like term, neotree
tuanbass Mar 9, 2023
761acd2
Add shortcut for increase / decrease folding
tuanbass Mar 16, 2023
ff60fca
feat(explorer): migrate to use on_attach for key key_mapping
tuanbass Mar 21, 2023
609f4fd
enable git sign (required for Gitblock info in statusline)
tuanbass Mar 21, 2023
bc7eec5
some todo status changes
tuanbass Mar 21, 2023
3571525
feat(explorer): migrate to use on_attach for key key_mapping
tuanbass Mar 21, 2023
26ac77b
enable Diag for typescript
tuanbass Mar 22, 2023
413bf3d
Add user module to interact with githubi
tuanbass Mar 28, 2023
c5c2cce
feat: add module copilot use official plugin
tuanbass Mar 29, 2023
485c43a
feat: add module copilot using copilot.lua
tuanbass Mar 29, 2023
ba9080f
Merge pull request #15 from tuanbass/feature/copilot
tuanbass Mar 30, 2023
35aae28
Update reference
tuanbass Mar 30, 2023
2686a56
feat: change order for vim-expand-region
tuanbass Mar 30, 2023
4807065
Prevent cmp from auto select the first suggestion
tuanbass Mar 31, 2023
567444b
Rename template
tuanbass Mar 31, 2023
40636c1
feat: add mini and session modules
tuanbass Mar 31, 2023
bb87ce6
minor changes: case insensitive in search
tuanbass Mar 31, 2023
8100dec
custom the dashboard page
tuanbass Mar 31, 2023
ab6d3f9
Add hydra module
tuanbass Mar 31, 2023
89cac07
Add the telescope picker to search all actions available in Octo
tuanbass Apr 1, 2023
8a59ab1
disable groups in Bufferline
tuanbass Apr 6, 2023
8559264
issue #17: cleaner tab and window relation
tuanbass Apr 6, 2023
705a403
Always show tabline, even open only 1 buffer
tuanbass Apr 10, 2023
d2017e8
feat(copilot2): add black and whitelist file types for copilot2
tuanbass Apr 10, 2023
feaced1
auto closetab when close neogit
tuanbass Apr 10, 2023
4e31039
default mode for module key binding
tuanbass Apr 10, 2023
a5bf9d0
add "g?" shortcut for octo menu in issue buffer
tuanbass Apr 10, 2023
77c3f30
fix: bug crash when having module with empty module.binds
tuanbass Apr 11, 2023
a9cf7c8
Add DO-NOTHING-MODULE for testing purpose
tuanbass Apr 11, 2023
87c99b1
change shortcut for hopchar to "t"
tuanbass Apr 13, 2023
9d647d2
merge from upstream
tuanbass Apr 15, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
112 changes: 112 additions & 0 deletions Daniel_plugin.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
Notation:
+++: Already install
---: Not interest, will not install
***: Interest, but not install yet

-- • FixCursorHold.nvim (nvim fixed bug)
-- • LuaSnip • aurora (not loaded)
-- • barbar.nvim tabline
• better-escape.nvim (not loaded)
+++• cmp-buffer
+++• cmp-cmdline
+++• cmp-nvim-lsp
---• cmp-nvim-lsp-signature-help: function signature for lsp. already have with lsp_signature.nvim
+++• cmp-path
--- • cmp-spell: spell check
+++• cmp_luasnip
-- • codi.vim -- Python scratch pad
+++• commented.nvim (not loaded)
***• copilot-cmp (not loaded)
***• copilot.vim
---• crates.nvim (not loaded): Package managemment for rust. Similar to package-info for javascript
***• dap-buddy.nvim
•+++dashboard-nvim
---• filetype.nvim
+++• friendly-snippets
***• git-conflict.nvim
***• github-ci.nvim (not loaded)-- plugin by daniel, not complete. require "hub"
***• gitlinker.nvim (not loaded) -- Generate code link
+++• gitsigns.nvim
---• gruvqueen (not loaded) -- theme
***• hlargs.nvim -- Highlight arguments' definitions and usages, asynchronously, using Treesitter, already have ability from unknown source
+++• impatient.nvim (enhance performance loading lua module )
+++• indent-blankline.nvim -- indent sign (|)
***• iswap.nvim -- swap order of func param
+++• lazygit.nvim (not loaded)
+++• lightspeed.nvim -- like HOP plugin
+++• lsp-colors.nvim
---• lsp-status.nvim
---• lspkind-nvim (them Icon cho LSP suggestion)
---• lua-dev.nvim (manually loaded) : Now : neodev: Support dev in lua (signature, completion, docs). Use LSP instead
+++• markdown-preview.nvim
---• material.nvim theme
---• mkdir.nvim
+++• neogen (not loaded) Function doc/comment
+++• neogit
---• neomake (not loaded)
***• neotest
***• noice.nvim
***• nui.nvim
+++• nvim-autopairs -- Auto generate close bracket when type open brackt
---• nvim-bqf (not loaded) -- better quick fix
+++• nvim-cmp
---• nvim-colorizer.lua Highlight color code (#AABBCC) by exactly color
***• nvim-coverage
***• nvim-dap (not loaded)
***• nvim-dap-python (not loaded)
***• nvim-dap-ui (not loaded)
---• nvim-gps (deprecated, use nvim-navic). Show breadccum for code context.
---• nvim-jdtls (not loaded) -- lsp adapter for eclipse jdt
***• nvim-lspconfig
---• nvim-navic
***• nvim-notify
+++• nvim-tree.lua (not loaded)
+++• nvim-treesitter
***• nvim-treesitter-textobjects allow define moving object (like iw, if..). similar to vim-textobj-xxx
***• nvim-treesitter-textsubjects similar tor expand-region (maybe smarter)
+++• nvim-ts-autotag -- Use treesitter to autoclose and autorename html tag
+++• nvim-ts-context-commentstring determine commentstring symbol (//, --...) by the context
+++• nvim-ufo -- folding
+++• nvim-web-devicons default icon for filetype(in tree for example)
--- • nvim-yati -- Indent plugin with treesitter deprecated
--- • nvimux (not loaded) tmux with nvim
--- • one-small-step-for-vimkind DAP adapter for neovim lua
***• orgmode.nvim (not loaded)
*** • package-info.nvim (not loaded) check and version manager for package.json (js, ts)
+++• packer.nvim (manually loaded)
---• playground (not loaded) show Treesitter infomation in nvim
+++• plenary.nvim async call
---• presence.nvim -- Discord Rich Presence plugin for Neovim
--- • preview-swagger.nvim (not loaded) -- Preview swager in real time
--- • promise-async support Promise/async in lua
+++• refactoring.nvim (refactoring pattern)
--- • rust.vim (not loaded) syntax Highlight, syntax check, format for rust. (Think: should use lsp instead)
***• sniprun (not loaded) run code for lua, rust. Support different type of output (virtual text, floating win, notification, term...)
-- • sonokai (not loaded) -- theme
---• spellsitter.nvim: Already merged into neovim core
-- • stabilize.nvim -- Neovim plugin to stabilize buffer content on window open/close events.
---• suda.vim (not loaded): No need, as with "w!", neovim auto chown for the file
-- • surround.nvim
***• tabout.nvim smart jump between parenthese, quotes ... by press Tab
+++• telescope-file-browser.nvim
+++• telescope-fzf-native.nvim
+++• telescope-project.nvim Project manipulate
+++• telescope-ui-select.nvim
+++• telescope.nvim
+++• todo-comments.nvim (not loaded)
--- • tokyonight.nvim (not loaded) theme
+++• trouble.nvim (not loaded)
---• urlview.nvim (list of all url in buffer like telescope)
*** • vgit.nvim -- like neogit. TODO: try to check
*** • vim-dispatch (not loaded) async for make and test
--- • vim-fugitive (not loaded) git manipulate (like neogit)
--- • vim-grammarous (not loaded) Grammar check on demand (depend on LanguageTool)
+++• vim-matchup advance match open/close pair (bracket, function, treesitter...)
--- • vim-slash (not loaded) -- improve search in nvim (press '/') (auto clear Highlight, starsearch)
***• vim-test (not loaded)
---• vimwiki (not loaded) organize (like orgmode) in wiki format
---• vscode.nvim (not loaded) Vscoe theme
+++• which-key.nvim
---• windline.nvim (look/feel of statusline)
***• window-picker.nvim quick navigate, swap and close window by shortcut
*** dense-analysis/ale
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ You can find a full list of modules [here](./docs/modules.md#all-modules)
Doom nvim provides a number of config options, including wrapping some of vim's
own options. See all available config options [in the API Reference](./docs/api.md).


```lua
-- config.lua

Expand Down Expand Up @@ -327,7 +328,8 @@ You will also need to delete `packer_compiled.lua` from `$XDG_DATA_HOME/nvim/plu

## Contributing

For for information please see our [contributing docs](./docs/contributing.md).
For for information please see our [contributing docs](./docs/contributing.md).<br>
Also try to refer to [excelent guide to develop in nvim lua](https://github.com/nanotee/nvim-lua-guide)

## Contributors

Expand Down
208 changes: 201 additions & 7 deletions config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,14 @@
-- automatically).

-- ADDING A PACKAGE
--
-- doom.use_package("EdenEast/nightfox.nvim", "sainnhe/sonokai")
-- doom.use_package({
-- doom.use_package("EdenEast/nightfox.nvim", "sainnhe/sonokai") doom.use_package({
-- "ur4ltz/surround.nvim",
-- config = function()
-- require("surround").setup({mappings_style = "sandwich"})
-- end
-- })

-- ADDING A KEYBIND
--
-- doom.use_keybind({
-- ADDING A KEYBIND doom.use_keybind({
-- -- The `name` field will add the keybind to whichkey
-- {"<leader>s", name = '+search', {
-- -- Bind to a vim command
Expand All @@ -41,4 +37,202 @@
-- { "FileType", "javascript", function() print('This is a javascript file') end }
-- })

-- vim: sw=2 sts=2 ts=2 expandtab
-- doom.indent = 2
-- doom.core.treesitter.settings.show_compiler_warning_message = false
doom.ignorecase = true
doom.core.reloader.settings.reload_on_save = false
--
if doom.langs.lua ~= nil then
doom.langs.lua.settings.disable_lsp = true
end

if doom.features.lsp ~= nil then
doom.features.lsp.requires_modules = { "features.auto_install" }
doom.features.lsp.settings.completion.sources = {
{ name = "copilot" },
{ name = "nvim_lua" },
{ name = "nvim_lsp" },
{ name = "luasnip" },
{ name = "path" },
{ name = "buffer" },
}
-- doom.features.lsp.settings.completion.completeopt="menu,menuone,preview,noinsert,noselect" -- force user choose an item to complete
doom.features.lsp.settings.completion.completeopt="menu,menuone,preview,noinsert,noselect" -- force user choose an item to complete
end


-- not hide file with any prifix
doom.features.explorer.settings.filters.custom={}
-- doom.features.
-- -- vim: sw=2 sts=2 ts=2 expandtab
-- --
-- -- custom keybindings for tabline
if doom.features.tabline ~= nil then
doom.features.tabline.settings.options.enforce_regular_tabs = false
doom.features.tabline.binds = {
{
"H",
name = "Left",
function()
require("bufferline").cycle(-1)
end,
},
{
"L",
name = "Left",
function()
require("bufferline").cycle(1)
end,
},
}
end
-- -- custom keybindings for comments
-- --
if doom.features.comment ~= nil then
doom.features.comment.binds = {
{
"gc",
[[<Esc><cmd>lua require("Comment.api").toggle.linewise(vim.fn.visualmode())<CR>]],
name = "Comment line",
mode = "v",
},
{
"gcc",
[[<cmd>lua require("Comment.api").toggle.linewise.current()<CR>]],
name = "Comment line",
},
{
"gcA",
[[<cmd>lua require("Comment.api").insert.linewise.eol()<CR>]],
name = "Comment end of line",
mode = "ni",
},
}
end
-- -- custom setting for markdown
-- -- doom.langs.markdown.settings.disable_lsp = true
-- -- custom setting for
--
-- --
if doom.features.whichkey ~= nil then
doom.features.whichkey.settings.plugins.marks = true
doom.features.whichkey.settings.plugins.presets.operators = true
doom.features.whichkey.settings.plugins.registers = true
end

if doom.features.fold ~= nil then
doom.features.fold.settings.foldlevelstart = 99
end
-- --
-- --
-- --
-- -- some un categorized plugin here
-- -- TODO: Will move them into a module
--

doom.use_package({
"WhoIsSethDaniel/toggle-lsp-diagnostics.nvim",
config = function()
require("toggle_lsp_diagnostics").init()
end,
})
--
--
-- -- Packer
--
------------------------------------------------------
-- doom.use_package({
-- "folke/noice.nvim",
-- config = function()
-- require("noice").setup({
--
-- notify = { enabled = true, view = "notify" },
-- messages = { enabled = true, view = "mini", view_error = "notify", view_warn = "notify" },
-- -- messages = {enabled = true, view = "mini"},
-- lsp = {
-- -- progress = {enabled = false},
-- hover = { enabled = false },
-- signature = { enabled = false },
-- },
-- })
-- end,
-- requires = {
-- -- if you lazy-load any plugin below, make sure to add proper `module="..."` entries
-- "MunifTanjim/nui.nvim",
-- -- OPTIONAL:
-- -- `nvim-notify` is only needed, if you want to use the notification view.
-- -- If not available, we use `mini` as the fallback
-- "rcarriga/nvim-notify",
-- },
-- })
------------------------------------------------------
--
-- doom.use_package {
-- 'iamcco/markdown-preview.nvim',
-- run = function() vim.fn['mkdp#util#install']() end, -- if it is not work, sometime you need to manual run this command to instal dependency
-- ft = {'markdown', 'md'}
-- }
-- doom.use_package {"SidOfc/mkdx",
-- ft = {'markdown', 'md'}
-- }
--
-- doom.use_package {"rafcamlet/nvim-luapad"}
-- doom.use_package 'anuvyklack/hydra.nvim'
-- -- fold setting
local opt = vim.opt
opt.list = true
opt.listchars:append("eol:↴")

-- tab options
opt.tabstop = 2
opt.shiftwidth = 4
opt.expandtab = true
--
-- confirm when delete
opt.confirm = true
--
-- opt.foldmethod = "expr"
-- opt.foldlevel = 1
-- opt.foldlevelstart = 1
-- opt.foldexpr = "nvim_treesitter#foldexpr()"
--
--
-- vim.cmd([[
-- " hi CursorLine cterm=NONE ctermbg=green ctermfg=white guibg=green guifg=white
-- " hi CursorLine cterm=NONE ctermbg=green guibg=green
-- " hi CursorLine cterm=NONE ctermfg=white guibg=green guifg=white
-- hi CursorLine cterm=underline guibg=#21252a
--
-- ]])

vim.opt.shortmess = "F"

-- special for telescope find_files: in some windows we should not allow it to open
-- TODO: move this snippet into a moduel
local prohitbitedBuf = {
"term:",
"NvimTree_",
}

function telescope_find_files_custom()
local title = vim.fn.bufname("%")
if (#vim.api.nvim_list_wins() > 1 )then -- 2 windows or more open, we should no allow open telescope in Neotree, term...


for i, x in pairs(prohitbitedBuf) do
if title:find(x) == 1 then
-- this window title is prohibited
print("could not open find_files in this window")
return
end
end
end

require("telescope.builtin").find_files()
end
--
doom.use_keybind({
-- The `name` field will add the keybind to whichkey
{ "<leader>ff", name = "find_file_adv", ':lua telescope_find_files_custom()<CR>',
} ,
})
18 changes: 15 additions & 3 deletions lua/doom/core/modules.lua
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,21 @@ modules.load_modules = function()
end

if module.binds then
keymaps_service.applyKeymaps(
type(module.binds) == "function" and module.binds() or module.binds
)
local bind_config = type(module.binds) == "function" and module.binds() or module.binds
if (bind_config.mode == nil) then
bind_config.mode = "nv"
end

if (#bind_config >0) then
keymaps_service.applyKeymaps(
-- type(module.binds) == "function" and module.binds() or module.binds
bind_config
)
else
-- without assign it to nil, it crashed if a module declare module.binds as an empty collection
-- Not really found the root cause, but this is the easiest way to avoid it
module.binds = nil
end
end
end
profiler.stop(profile_msg)
Expand Down
Loading