added venn.nvim

This commit is contained in:
Gabe Venberg 2022-10-03 10:12:26 -05:00
parent fd26808e8e
commit c8bda3b426
4 changed files with 119 additions and 35 deletions

View file

@ -3,7 +3,7 @@ library: ~/Music/library.db
import: import:
move: yes move: yes
write: yes write: yes
plugins: [edit, fetchart, chroma, thumbnails, replaygain, mbsync, fuzzy, duplicates, badfiles] plugins: [edit, fetchart, chroma, thumbnails, replaygain, mbsync, fuzzy, duplicates, badfiles, fromfilename]
replaygain: replaygain:
auto: no auto: no
backend: ffmpeg backend: ffmpeg

View file

@ -74,6 +74,27 @@ require('packages')
--sets colorscheme. to get a list of avalible options, do colorscheme <Space> <C-d> --sets colorscheme. to get a list of avalible options, do colorscheme <Space> <C-d>
vim.cmd 'colorscheme moonfly' vim.cmd 'colorscheme moonfly'
--function for venn.nvim
-- venn.nvim: enable or disable keymappings
function _G.Toggle_venn()
local venn_enabled = vim.inspect(vim.b.venn_enabled)
if venn_enabled == "nil" then
vim.b.venn_enabled = true
vim.cmd[[setlocal ve=all]]
-- draw a line on HJKL keystokes
vim.api.nvim_buf_set_keymap(0, "n", "J", "<C-v>j:VBox<CR>", {noremap = true})
vim.api.nvim_buf_set_keymap(0, "n", "K", "<C-v>k:VBox<CR>", {noremap = true})
vim.api.nvim_buf_set_keymap(0, "n", "L", "<C-v>l:VBox<CR>", {noremap = true})
vim.api.nvim_buf_set_keymap(0, "n", "H", "<C-v>h:VBox<CR>", {noremap = true})
-- draw a box by pressing "f" with visual selection
vim.api.nvim_buf_set_keymap(0, "v", "f", ":VBox<CR>", {noremap = true})
else
vim.cmd[[setlocal ve=]]
vim.cmd[[mapclear <buffer>]]
vim.b.venn_enabled = nil
end
end
--keyboard mappings --keyboard mappings
local opts = { noremap=true, silent=true } local opts = { noremap=true, silent=true }
--toggle spell check --toggle spell check
@ -114,3 +135,13 @@ vim.cmd 'colorscheme moonfly'
map('n', 'gF', ':TablineBufferPrevious<CR>', opts) map('n', 'gF', ':TablineBufferPrevious<CR>', opts)
--gitsigns --gitsigns
map('n', '<leader>bl', ':Gitsigns toggle_current_line_blame<CR>', opts) map('n', '<leader>bl', ':Gitsigns toggle_current_line_blame<CR>', opts)
--trouble plugin.
vim.keymap.set("n", "<leader>xx", "<cmd>TroubleToggle<cr>", opts)
vim.keymap.set("n", "<leader>xw", "<cmd>TroubleToggle workspace_diagnostics<cr>", opts)
vim.keymap.set("n", "<leader>xd", "<cmd>TroubleToggle document_diagnostics<cr>", opts)
vim.keymap.set("n", "<leader>xl", "<cmd>TroubleToggle loclist<cr>", opts)
vim.keymap.set("n", "<leader>xq", "<cmd>TroubleToggle quickfix<cr>", opts)
vim.keymap.set("n", "<leader>lR", "<cmd>TroubleToggle lsp_references<cr>", opts)
vim.keymap.set("n", "<leader>lD", "<cmd>TroubleToggle lsp_definitions<cr>", opts)
-- toggle keymappings for venn using <leader>v
vim.api.nvim_set_keymap('n', '<leader>v', ":lua Toggle_venn()<CR>", { noremap = true})

View file

@ -11,22 +11,22 @@ local on_attach = function()
local opts = { noremap=true, silent=true } local opts = { noremap=true, silent=true }
-- See `:help vim.lsp.*` for documentation on any of the below functions -- See `:help vim.lsp.*` for documentation on any of the below functions
set_keymap('', ';lc', '<cmd>lua vim.lsp.buf.declaration()<CR>', opts) set_keymap('', '<leader>lc', '<cmd>lua vim.lsp.buf.declaration()<CR>', opts)
set_keymap('', ';lf', '<cmd>lua vim.lsp.buf.definition()<CR>', opts) set_keymap('', '<leader>lf', '<cmd>lua vim.lsp.buf.definition()<CR>', opts)
set_keymap('', ';lh', '<cmd>lua vim.lsp.buf.hover()<CR>', opts) set_keymap('', '<leader>lh', '<cmd>lua vim.lsp.buf.hover()<CR>', opts)
set_keymap('', ';li', '<cmd>lua vim.lsp.buf.implementation()<CR>', opts) set_keymap('', '<leader>li', '<cmd>lua vim.lsp.buf.implementation()<CR>', opts)
set_keymap('', ';ls', '<cmd>lua vim.lsp.buf.signature_help()<CR>', opts) set_keymap('', '<leader>ls', '<cmd>lua vim.lsp.buf.signature_help()<CR>', opts)
set_keymap('', ';lwa', '<cmd>lua vim.lsp.buf.add_workspace_folder()<CR>', opts) set_keymap('', '<leader>lwa', '<cmd>lua vim.lsp.buf.add_workspace_folder()<CR>', opts)
set_keymap('', ';lwr', '<cmd>lua vim.lsp.buf.remove_workspace_folder()<CR>', opts) set_keymap('', '<leader>lwr', '<cmd>lua vim.lsp.buf.remove_workspace_folder()<CR>', opts)
set_keymap('', ';lw', '<cmd>lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))<CR>', opts) set_keymap('', '<leader>lw', '<cmd>lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))<CR>', opts)
set_keymap('', ';lt', '<cmd>lua vim.lsp.buf.type_definition()<CR>', opts) set_keymap('', '<leader>lt', '<cmd>lua vim.lsp.buf.type_definition()<CR>', opts)
set_keymap('', ';lr', '<cmd>lua vim.lsp.buf.rename()<CR>', opts) set_keymap('', '<leader>lr', '<cmd>lua vim.lsp.buf.rename()<CR>', opts)
set_keymap('', ';la', '<cmd>lua vim.lsp.buf.code_action()<CR>', opts) set_keymap('', '<leader>la', '<cmd>lua vim.lsp.buf.code_action()<CR>', opts)
set_keymap('', ';le', '<cmd>lua vim.lsp.buf.references()<CR>', opts) set_keymap('', '<leader>le', '<cmd>lua vim.lsp.buf.references()<CR>', opts)
set_keymap('', ';lo', '<cmd>lua vim.diagnostic.open_float()<CR>', opts) set_keymap('', '<leader>lo', '<cmd>lua vim.diagnostic.open_float()<CR>', opts)
set_keymap('', ';ln', '<cmd>lua vim.diagnostic.goto_prev()<CR>', opts) set_keymap('', '<leader>ln', '<cmd>lua vim.diagnostic.goto_prev()<CR>', opts)
set_keymap('', ';lp', '<cmd>lua vim.diagnostic.goto_next()<CR>', opts) set_keymap('', '<leader>lp', '<cmd>lua vim.diagnostic.goto_next()<CR>', opts)
set_keymap('', ';lm', '<cmd>lua vim.lsp.buf.formatting()<CR>', opts) set_keymap('', '<leader>lm', '<cmd>lua vim.lsp.buf.formatting()<CR>', opts)
end end
require("mason-lspconfig").setup_handlers({ require("mason-lspconfig").setup_handlers({
function(server_name) function(server_name)

View file

@ -97,7 +97,6 @@ return require('packer').startup(function(use)
require("luasnip.loaders.from_snipmate").load() require("luasnip.loaders.from_snipmate").load()
require("luasnip.loaders.from_vscode").load() require("luasnip.loaders.from_vscode").load()
end end
} }
use {'nvim-telescope/telescope.nvim', use {'nvim-telescope/telescope.nvim',
@ -107,9 +106,22 @@ return require('packer').startup(function(use)
{'nvim-treesitter/nvim-treesitter'}, {'nvim-treesitter/nvim-treesitter'},
{'nvim-telescope/telescope-symbols.nvim'}, {'nvim-telescope/telescope-symbols.nvim'},
{'nvim-telescope/telescope-file-browser.nvim'}, {'nvim-telescope/telescope-file-browser.nvim'},
{'folke/trouble.nvim'},
},
config = function()
local trouble = require("trouble.providers.telescope")
require('telescope').setup {
defaults = {
mappings = {
i = { ["<c-t>"] = trouble.open_with_trouble },
n = { ["<c-t>"] = trouble.open_with_trouble },
},
}, },
} }
end
}
--file browser
use {'kyazdani42/nvim-tree.lua', use {'kyazdani42/nvim-tree.lua',
requires = { requires = {
'kyazdani42/nvim-web-devicons', -- optional, for file icon 'kyazdani42/nvim-web-devicons', -- optional, for file icon
@ -229,11 +241,54 @@ return require('packer').startup(function(use)
requires = { { 'hoob3rt/lualine.nvim', opt=true }, {'kyazdani42/nvim-web-devicons', opt = true} } requires = { { 'hoob3rt/lualine.nvim', opt=true }, {'kyazdani42/nvim-web-devicons', opt = true} }
} }
use { use {'folke/trouble.nvim',
"folke/trouble.nvim",
requires = "kyazdani42/nvim-web-devicons", requires = "kyazdani42/nvim-web-devicons",
config = function() config = function() require("trouble").setup {
require("trouble").setup { position = "bottom", -- position of the list can be: bottom, top, left, right
height = 10, -- height of the trouble list when position is top or bottom
width = 50, -- width of the list when position is left or right
icons = true, -- use devicons for filenames
mode = "workspace_diagnostics", -- "workspace_diagnostics", "document_diagnostics", "quickfix", "lsp_references", "loclist"
fold_open = "", -- icon used for open folds
fold_closed = "", -- icon used for closed folds
group = true, -- group results by file
padding = true, -- add an extra new line on top of the list
action_keys = { -- key mappings for actions in the trouble list
-- map to {} to remove a mapping, for example:
-- close = {},
close = "q", -- close the list
cancel = "<esc>", -- cancel the preview and get back to your last window / buffer / cursor
refresh = "r", -- manually refresh
jump = {"<cr>", "<tab>"}, -- jump to the diagnostic or open / close folds
open_split = { "<c-x>" }, -- open buffer in new split
open_vsplit = { "<c-v>" }, -- open buffer in new vsplit
open_tab = { "<c-t>" }, -- open buffer in new tab
jump_close = {"o"}, -- jump to the diagnostic and close the list
toggle_mode = "m", -- toggle between "workspace" and "document" diagnostics mode
toggle_preview = "P", -- toggle auto_preview
hover = "K", -- opens a small popup with the full multiline message
preview = "p", -- preview the diagnostic location
close_folds = {"zM", "zm"}, -- close all folds
open_folds = {"zR", "zr"}, -- open all folds
toggle_fold = {"zA", "za", '<space>'}, -- toggle fold of current file
previous = "k", -- previous item
next = "j" -- next item
},
indent_lines = true, -- add an indent guide below the fold icons
auto_open = false, -- automatically open the list when you have diagnostics
auto_close = false, -- automatically close the list when you have no diagnostics
auto_preview = true, -- automatically preview the location of the diagnostic. <esc> to close preview and go back to last window
auto_fold = false, -- automatically fold a file trouble list at creation
auto_jump = {"lsp_definitions"}, -- for the given modes, automatically jump if there is only a single result
signs = {
-- icons / text used for a diagnostic
error = "",
warning = "",
hint = "",
information = "",
other = ""
},
use_diagnostic_signs = false -- enabling this will use the signs defined in your lsp client
} }
end end
} }
@ -274,6 +329,8 @@ return require('packer').startup(function(use)
end end
} }
use "jbyuki/venn.nvim"
--misc --misc
use { use {
@ -283,7 +340,6 @@ return require('packer').startup(function(use)
} }
use {'sudormrfbin/cheatsheet.nvim', use {'sudormrfbin/cheatsheet.nvim',
requires = { requires = {
{'nvim-telescope/telescope.nvim'}, {'nvim-telescope/telescope.nvim'},
{'nvim-lua/popup.nvim'}, {'nvim-lua/popup.nvim'},
@ -297,9 +353,6 @@ return require('packer').startup(function(use)
use 'bluz71/vim-nightfly-guicolors' use 'bluz71/vim-nightfly-guicolors'
--language specific tools.
if Packer_Bootstrap then if Packer_Bootstrap then
require('packer').sync() require('packer').sync()
end end