added venn.nvim
This commit is contained in:
parent
fd26808e8e
commit
c8bda3b426
|
@ -3,7 +3,7 @@ library: ~/Music/library.db
|
|||
import:
|
||||
move: 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:
|
||||
auto: no
|
||||
backend: ffmpeg
|
||||
|
|
|
@ -74,6 +74,27 @@ require('packages')
|
|||
--sets colorscheme. to get a list of avalible options, do colorscheme <Space> <C-d>
|
||||
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
|
||||
local opts = { noremap=true, silent=true }
|
||||
--toggle spell check
|
||||
|
@ -114,3 +135,13 @@ vim.cmd 'colorscheme moonfly'
|
|||
map('n', 'gF', ':TablineBufferPrevious<CR>', opts)
|
||||
--gitsigns
|
||||
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})
|
||||
|
|
|
@ -11,22 +11,22 @@ local on_attach = function()
|
|||
local opts = { noremap=true, silent=true }
|
||||
|
||||
-- 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('', ';lf', '<cmd>lua vim.lsp.buf.definition()<CR>', opts)
|
||||
set_keymap('', ';lh', '<cmd>lua vim.lsp.buf.hover()<CR>', opts)
|
||||
set_keymap('', ';li', '<cmd>lua vim.lsp.buf.implementation()<CR>', opts)
|
||||
set_keymap('', ';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('', ';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('', ';lt', '<cmd>lua vim.lsp.buf.type_definition()<CR>', opts)
|
||||
set_keymap('', ';lr', '<cmd>lua vim.lsp.buf.rename()<CR>', opts)
|
||||
set_keymap('', ';la', '<cmd>lua vim.lsp.buf.code_action()<CR>', opts)
|
||||
set_keymap('', ';le', '<cmd>lua vim.lsp.buf.references()<CR>', opts)
|
||||
set_keymap('', ';lo', '<cmd>lua vim.diagnostic.open_float()<CR>', opts)
|
||||
set_keymap('', ';ln', '<cmd>lua vim.diagnostic.goto_prev()<CR>', opts)
|
||||
set_keymap('', ';lp', '<cmd>lua vim.diagnostic.goto_next()<CR>', opts)
|
||||
set_keymap('', ';lm', '<cmd>lua vim.lsp.buf.formatting()<CR>', opts)
|
||||
set_keymap('', '<leader>lc', '<cmd>lua vim.lsp.buf.declaration()<CR>', opts)
|
||||
set_keymap('', '<leader>lf', '<cmd>lua vim.lsp.buf.definition()<CR>', opts)
|
||||
set_keymap('', '<leader>lh', '<cmd>lua vim.lsp.buf.hover()<CR>', opts)
|
||||
set_keymap('', '<leader>li', '<cmd>lua vim.lsp.buf.implementation()<CR>', opts)
|
||||
set_keymap('', '<leader>ls', '<cmd>lua vim.lsp.buf.signature_help()<CR>', opts)
|
||||
set_keymap('', '<leader>lwa', '<cmd>lua vim.lsp.buf.add_workspace_folder()<CR>', opts)
|
||||
set_keymap('', '<leader>lwr', '<cmd>lua vim.lsp.buf.remove_workspace_folder()<CR>', opts)
|
||||
set_keymap('', '<leader>lw', '<cmd>lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))<CR>', opts)
|
||||
set_keymap('', '<leader>lt', '<cmd>lua vim.lsp.buf.type_definition()<CR>', opts)
|
||||
set_keymap('', '<leader>lr', '<cmd>lua vim.lsp.buf.rename()<CR>', opts)
|
||||
set_keymap('', '<leader>la', '<cmd>lua vim.lsp.buf.code_action()<CR>', opts)
|
||||
set_keymap('', '<leader>le', '<cmd>lua vim.lsp.buf.references()<CR>', opts)
|
||||
set_keymap('', '<leader>lo', '<cmd>lua vim.diagnostic.open_float()<CR>', opts)
|
||||
set_keymap('', '<leader>ln', '<cmd>lua vim.diagnostic.goto_prev()<CR>', opts)
|
||||
set_keymap('', '<leader>lp', '<cmd>lua vim.diagnostic.goto_next()<CR>', opts)
|
||||
set_keymap('', '<leader>lm', '<cmd>lua vim.lsp.buf.formatting()<CR>', opts)
|
||||
end
|
||||
require("mason-lspconfig").setup_handlers({
|
||||
function(server_name)
|
||||
|
|
|
@ -97,7 +97,6 @@ return require('packer').startup(function(use)
|
|||
require("luasnip.loaders.from_snipmate").load()
|
||||
require("luasnip.loaders.from_vscode").load()
|
||||
end
|
||||
|
||||
}
|
||||
|
||||
use {'nvim-telescope/telescope.nvim',
|
||||
|
@ -107,9 +106,22 @@ return require('packer').startup(function(use)
|
|||
{'nvim-treesitter/nvim-treesitter'},
|
||||
{'nvim-telescope/telescope-symbols.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',
|
||||
requires = {
|
||||
'kyazdani42/nvim-web-devicons', -- optional, for file icon
|
||||
|
@ -158,10 +170,10 @@ return require('packer').startup(function(use)
|
|||
--UI stuff
|
||||
|
||||
use {'simrat39/symbols-outline.nvim',
|
||||
config=function() vim.g.symbols_outline={
|
||||
width=25,
|
||||
relative_width=false
|
||||
}end
|
||||
config=function() vim.g.symbols_outline={
|
||||
width=25,
|
||||
relative_width=false
|
||||
}end
|
||||
}
|
||||
|
||||
use 'yamatsum/nvim-cursorline'
|
||||
|
@ -173,8 +185,8 @@ return require('packer').startup(function(use)
|
|||
}
|
||||
|
||||
use {'nvim-lualine/lualine.nvim',
|
||||
requires = {'kyazdani42/nvim-web-devicons', opt = true},
|
||||
config=function() require('lualine').setup{
|
||||
requires = {'kyazdani42/nvim-web-devicons', opt = true},
|
||||
config=function() require('lualine').setup{
|
||||
options={
|
||||
icons_enabled = true,
|
||||
theme = 'auto',
|
||||
|
@ -229,13 +241,56 @@ return require('packer').startup(function(use)
|
|||
requires = { { 'hoob3rt/lualine.nvim', opt=true }, {'kyazdani42/nvim-web-devicons', opt = true} }
|
||||
}
|
||||
|
||||
use {
|
||||
"folke/trouble.nvim",
|
||||
requires = "kyazdani42/nvim-web-devicons",
|
||||
config = function()
|
||||
require("trouble").setup {
|
||||
}
|
||||
end
|
||||
use {'folke/trouble.nvim',
|
||||
requires = "kyazdani42/nvim-web-devicons",
|
||||
config = function() 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
|
||||
}
|
||||
|
||||
use {'romgrk/nvim-treesitter-context',
|
||||
|
@ -274,6 +329,8 @@ return require('packer').startup(function(use)
|
|||
end
|
||||
}
|
||||
|
||||
use "jbyuki/venn.nvim"
|
||||
|
||||
--misc
|
||||
|
||||
use {
|
||||
|
@ -283,7 +340,6 @@ return require('packer').startup(function(use)
|
|||
}
|
||||
|
||||
use {'sudormrfbin/cheatsheet.nvim',
|
||||
|
||||
requires = {
|
||||
{'nvim-telescope/telescope.nvim'},
|
||||
{'nvim-lua/popup.nvim'},
|
||||
|
@ -297,9 +353,6 @@ return require('packer').startup(function(use)
|
|||
|
||||
use 'bluz71/vim-nightfly-guicolors'
|
||||
|
||||
--language specific tools.
|
||||
|
||||
|
||||
if Packer_Bootstrap then
|
||||
require('packer').sync()
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue