File Manager, Workspaces and some keybindings
- new plugins: . neo-tree - file manager . workspaces - workspace management (light projects) - keybindings . <leader>g for Neogit . <leader>t for Neotree . <leader>w for WorkspacesOpen . <space>D for fzf.diagnostics_workspace - options . truncate long lines in view (set nowrap)
This commit is contained in:
@@ -11,13 +11,15 @@
|
|||||||
"lualine.nvim": { "branch": "master", "commit": "b431d228b7bbcdaea818bdc3e25b8cdbe861f056" },
|
"lualine.nvim": { "branch": "master", "commit": "b431d228b7bbcdaea818bdc3e25b8cdbe861f056" },
|
||||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "482350b050bd413931c2cdd4857443c3da7d57cb" },
|
"mason-lspconfig.nvim": { "branch": "main", "commit": "482350b050bd413931c2cdd4857443c3da7d57cb" },
|
||||||
"mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" },
|
"mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" },
|
||||||
"mini.nvim": { "branch": "main", "commit": "19e1584124cda35388d4fdb911eab7124014e541" },
|
"neo-tree.nvim": { "branch": "v3.x", "commit": "29f7c215332ba95e470811c380ddbce2cebe2af4" },
|
||||||
"neogit": { "branch": "master", "commit": "9bc4ee89bb42be31a2f0b1da41e36e3e6cab9bbb" },
|
"neogit": { "branch": "master", "commit": "9bc4ee89bb42be31a2f0b1da41e36e3e6cab9bbb" },
|
||||||
|
"nui.nvim": { "branch": "main", "commit": "61574ce6e60c815b0a0c4b5655b8486ba58089a1" },
|
||||||
"nvim-cmp": { "branch": "main", "commit": "ae644feb7b67bf1ce4260c231d1d4300b19c6f30" },
|
"nvim-cmp": { "branch": "main", "commit": "ae644feb7b67bf1ce4260c231d1d4300b19c6f30" },
|
||||||
"nvim-lspconfig": { "branch": "master", "commit": "0ef64599b8aa0187ee5f6d92cb39c951f348f041" },
|
"nvim-lspconfig": { "branch": "master", "commit": "0ef64599b8aa0187ee5f6d92cb39c951f348f041" },
|
||||||
"nvim-treesitter": { "branch": "master", "commit": "a1573a9135c608e68cb383f752623527be84bdce" },
|
"nvim-treesitter": { "branch": "master", "commit": "a1573a9135c608e68cb383f752623527be84bdce" },
|
||||||
"nvim-web-devicons": { "branch": "master", "commit": "9793801f974bba70e4ac5d7eae6c4f5659993d8e" },
|
"nvim-web-devicons": { "branch": "master", "commit": "9793801f974bba70e4ac5d7eae6c4f5659993d8e" },
|
||||||
"orgmode": { "branch": "master", "commit": "e3500add486b17da58ce8e42a0f799161e5761c9" },
|
"orgmode": { "branch": "master", "commit": "e3500add486b17da58ce8e42a0f799161e5761c9" },
|
||||||
"plenary.nvim": { "branch": "master", "commit": "ec289423a1693aeae6cd0d503bac2856af74edaa" },
|
"plenary.nvim": { "branch": "master", "commit": "ec289423a1693aeae6cd0d503bac2856af74edaa" },
|
||||||
"which-key.nvim": { "branch": "main", "commit": "bfec3d6bc0a9b0b2cb11644642f78c2c3915eef0" }
|
"which-key.nvim": { "branch": "main", "commit": "bfec3d6bc0a9b0b2cb11644642f78c2c3915eef0" },
|
||||||
|
"workspaces.nvim": { "branch": "master", "commit": "0b03d3f2ffe38729b1792905ec447405ed76cb6e" }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,10 +5,16 @@ vim.keymap.set('n', '<leader>fs', fzf.blines, { desc = "Search buffer" })
|
|||||||
vim.keymap.set('n', '<leader>fg', fzf.live_grep, { desc = "Grep" })
|
vim.keymap.set('n', '<leader>fg', fzf.live_grep, { desc = "Grep" })
|
||||||
vim.keymap.set('n', '<leader>fG', fzf.grep_cword, { desc = "Grep word under cursor" })
|
vim.keymap.set('n', '<leader>fG', fzf.grep_cword, { desc = "Grep word under cursor" })
|
||||||
vim.keymap.set('n', '<leader>fc', fzf.commands, { desc = "Commands" })
|
vim.keymap.set('n', '<leader>fc', fzf.commands, { desc = "Commands" })
|
||||||
vim.keymap.set('n', '<leader>fC', fzf.command_history, { desc = "Command history" })
|
|
||||||
vim.keymap.set('n', '<leader>fm', fzf.manpages, { desc = "Manpages" })
|
vim.keymap.set('n', '<leader>fm', fzf.manpages, { desc = "Manpages" })
|
||||||
|
|
||||||
vim.keymap.set('n', '<leader>b', fzf.buffers, { desc = "Buffers" })
|
vim.keymap.set('n', '<leader>b', fzf.buffers, { desc = "Buffers" })
|
||||||
|
|
||||||
-- use fzf buffer lines as default search
|
-- use fzf buffer lines as default search
|
||||||
vim.keymap.set('n', '/', fzf.blines, { desc = "Search buffer" })
|
vim.keymap.set('n', '/', fzf.blines, { desc = "Search buffer" })
|
||||||
|
|
||||||
|
-- open file manager and git
|
||||||
|
vim.keymap.set('n', '<leader>g', ":Neogit<CR>", { desc = "Git Manager" })
|
||||||
|
vim.keymap.set('n', '<leader>t', ":Neotree<CR>", { desc = "File Manager" })
|
||||||
|
|
||||||
|
-- configure workspaces
|
||||||
|
vim.keymap.set('n', '<leader>w', ":WorkspacesOpen<CR>", { desc = "Open a workspace" })
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ local on_attach = function(client, bufnr)
|
|||||||
vim.keymap.set('n', '<space>wl', function()
|
vim.keymap.set('n', '<space>wl', function()
|
||||||
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
|
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
|
||||||
end, bufopts)
|
end, bufopts)
|
||||||
vim.keymap.set('n', '<space>D', vim.lsp.buf.type_definition, bufopts)
|
-- vim.keymap.set('n', '<space>D', vim.lsp.buf.type_definition, bufopts)
|
||||||
vim.keymap.set('n', '<space>rn', vim.lsp.buf.rename, bufopts)
|
vim.keymap.set('n', '<space>rn', vim.lsp.buf.rename, bufopts)
|
||||||
vim.keymap.set('n', '<space>ca', vim.lsp.buf.code_action, bufopts)
|
vim.keymap.set('n', '<space>ca', vim.lsp.buf.code_action, bufopts)
|
||||||
vim.keymap.set("n", "<space>f", function()
|
vim.keymap.set("n", "<space>f", function()
|
||||||
@@ -58,6 +58,7 @@ local on_attach = function(client, bufnr)
|
|||||||
|
|
||||||
local fzf = require('fzf-lua')
|
local fzf = require('fzf-lua')
|
||||||
vim.keymap.set('n', '<space>d', fzf.diagnostics_document , { desc = "Doc diagnostics" })
|
vim.keymap.set('n', '<space>d', fzf.diagnostics_document , { desc = "Doc diagnostics" })
|
||||||
|
vim.keymap.set('n', '<space>D', fzf.diagnostics_workspace, { desc = "Workspace diagnostics" })
|
||||||
vim.keymap.set('n', '<space>s', fzf.lsp_document_symbols, { desc = "Doc symbols" })
|
vim.keymap.set('n', '<space>s', fzf.lsp_document_symbols, { desc = "Doc symbols" })
|
||||||
-- vim.keymap.set('n', 'gr', vim.lsp.buf.references, bufopts)
|
-- vim.keymap.set('n', 'gr', vim.lsp.buf.references, bufopts)
|
||||||
vim.keymap.set('n', '<C-[>', fzf.lsp_references, { desc = "Find References" })
|
vim.keymap.set('n', '<C-[>', fzf.lsp_references, { desc = "Find References" })
|
||||||
|
|||||||
@@ -25,7 +25,8 @@ vim.opt.ignorecase = true -- ignore case in searches by default
|
|||||||
vim.opt.smartcase = true -- but make it case sensitive if an uppercase is entered
|
vim.opt.smartcase = true -- but make it case sensitive if an uppercase is entered
|
||||||
|
|
||||||
|
|
||||||
-- Wrapping movements
|
-- Wrapping movements and long lines
|
||||||
vim.opt.whichwrap = "b,s,<,>,[,]" -- wrap backspace, space and left-right cursor keys
|
vim.opt.whichwrap = "b,s,<,>,[,]" -- wrap backspace, space and left-right cursor keys
|
||||||
|
vim.opt.wrap = false
|
||||||
-- formatoptions not very well set
|
-- formatoptions not very well set
|
||||||
-- vim.opt.formatoptions = "tac"
|
-- vim.opt.formatoptions = "tac"
|
||||||
|
|||||||
@@ -181,4 +181,34 @@ require("lazy").setup({
|
|||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
|
-- neo-tree file management
|
||||||
|
{
|
||||||
|
"nvim-neo-tree/neo-tree.nvim",
|
||||||
|
branch = "v3.x",
|
||||||
|
dependencies = {
|
||||||
|
"nvim-lua/plenary.nvim",
|
||||||
|
"nvim-tree/nvim-web-devicons", -- not strictly required, but recommended
|
||||||
|
"MunifTanjim/nui.nvim",
|
||||||
|
-- "3rd/image.nvim", -- Optional image support in preview window: See `# Preview Mode` for more information
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
-- workspaces, lightweight "projects"
|
||||||
|
{
|
||||||
|
"natecraddock/workspaces.nvim",
|
||||||
|
config = function()
|
||||||
|
require("workspaces").setup {
|
||||||
|
-- option to automatically activate workspace when opening neovim in a workspace directory
|
||||||
|
auto_open = true,
|
||||||
|
|
||||||
|
-- option to automatically activate workspace when changing directory not via this plugin
|
||||||
|
auto_dir = true,
|
||||||
|
|
||||||
|
hooks = {
|
||||||
|
open = "FzfLua files"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
end
|
||||||
|
},
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user