update to toggleterm
This commit is contained in:
parent
a95aab0e51
commit
a9518b1718
1
init.lua
1
init.lua
@ -1,4 +1,3 @@
|
||||
-- Load core configurations
|
||||
require('core.options')
|
||||
require('core.keymaps')
|
||||
require('core.plugins')
|
||||
|
@ -35,7 +35,7 @@ autocmd('TextYankPost', {
|
||||
group = highlight_yank,
|
||||
pattern = '*',
|
||||
callback = function()
|
||||
vim.highlight.on_yank({ higroup = "IncSearch", timeout = 1000 })
|
||||
vim.highlight.on_yank({ higroup = "IncSearch", timeout = 420 })
|
||||
end,
|
||||
})
|
||||
|
||||
@ -49,3 +49,4 @@ autocmd('TextYankPost', {
|
||||
-- end
|
||||
-- end
|
||||
-- })
|
||||
|
||||
|
@ -1,18 +1,51 @@
|
||||
local map = vim.keymap.set
|
||||
local Terminal = require('toggleterm.terminal').Terminal
|
||||
local lazygit = Terminal:new({ cmd = 'lazygit', hidden = true })
|
||||
local ipython = Terminal:new({ cmd = 'ipython', hidden = true })
|
||||
local notify = require('notify')
|
||||
|
||||
local function term_factory(cfg)
|
||||
cfg["on_stderr"] = function(_, job, data, name)
|
||||
notify(name .. ' encountered an error on job: ' .. job .. '\nData: ' .. data)
|
||||
end
|
||||
cfg["on_stdout"] = function(_, job, data, name)
|
||||
notify(name .. ' output for job' .. job .. '\nData: ' .. data)
|
||||
end
|
||||
return Terminal:new(cfg)
|
||||
end
|
||||
|
||||
local function term_toggle(term)
|
||||
term:toggle()
|
||||
end
|
||||
|
||||
local opts = { silent = true, noremap = true }
|
||||
|
||||
|
||||
local function ReloadConfig()
|
||||
dofile(vim.fn.stdpath('config') .. '/init.lua')
|
||||
dofile(vim.fn.stdpath('config') .. '/lua/core/keymaps.lua')
|
||||
dofile(vim.fn.stdpath('config') .. '/lua/core/autocmds.lua')
|
||||
dofile(vim.fn.stdpath('config') .. '/lua/core/options.lua')
|
||||
dofile(vim.fn.stdpath('config') .. '/lua/core/plugins.lua')
|
||||
dofile(vim.fn.stdpath('config') .. '/lua/plugins/ui/init.lua')
|
||||
dofile(vim.fn.stdpath('config') .. '/lua/plugins/ui/toggleterm.lua')
|
||||
dofile(vim.fn.stdpath('config') .. '/lua/plugins/ai/init.lua')
|
||||
dofile(vim.fn.stdpath('config') .. '/lua/plugins/lsp/init.lua')
|
||||
dofile(vim.fn.stdpath('config') .. '/lua/plugins/colorscheme/init.lua')
|
||||
end
|
||||
|
||||
-- Leader key
|
||||
vim.g.mapleader = " "
|
||||
vim.g.maplocalleader = ","
|
||||
|
||||
-- Custom commands
|
||||
vim.api.nvim_create_user_command('PS', ':PackerSync', {})
|
||||
vim.api.nvim_create_user_command('Reload', 'source ~/.config/nvim/init.lua', {})
|
||||
vim.api.nvim_create_user_command('Reload', ReloadConfig, {})
|
||||
vim.api.nvim_create_user_command('Config', 'edit ~/.config/nvim/init.lua', {})
|
||||
vim.api.nvim_create_user_command('Plugins', 'edit ~/.config/nvim/lua/core/plugins.lua', {})
|
||||
vim.api.nvim_create_user_command('Keymaps', 'edit ~/.config/nvim/lua/core/keymaps.lua', {})
|
||||
|
||||
-- Basic mappings
|
||||
-- {{{ Basic mappings
|
||||
map('n', '<C-u>', '<C-u>zz', opts)
|
||||
map('n', 'n', 'nzzzv', opts)
|
||||
map('n', 'N', 'Nzzzv', opts)
|
||||
@ -21,27 +54,56 @@ map('v', '<', '<gv', opts) -- reselect after indent
|
||||
map('v', '>', '>gv', opts)
|
||||
map('v', 'J', ":m '>+1<CR>gv=gv", opts) -- move lines
|
||||
map('v', 'K', ":m '<-2<CR>gv=gv", opts)
|
||||
-- }}}
|
||||
|
||||
-- Buffer navigation
|
||||
-- {{{ Buffer navigation
|
||||
map('n', '<C-J>', ':bnext<CR>', opts)
|
||||
map('n', '<C-K>', ':bprev<CR>', opts)
|
||||
map('n', '<leader>bb', ':Telescope buffers<CR>', opts)
|
||||
map('n', '<leader>bk', ':bdelete<CR>', opts)
|
||||
map('n', '<leader>bn', ':bnext<CR>', opts)
|
||||
map('n', '<leader>bp', ':bprev<CR>', opts)
|
||||
-- }}}
|
||||
|
||||
-- Terminal mappings
|
||||
map('n', '<C-T>', ':wa<CR>:FloatermToggle floatterm<CR>', opts)
|
||||
map('t', '<C-T>', '<C-\\><C-n>:FloatermToggle floatterm<CR>', opts)
|
||||
map('t', '<Esc>', '<C-\\><C-n>', opts)
|
||||
map('n', '<leader>tt', ':FloatermToggle split-term<CR>', opts)
|
||||
map('t', '<leader>tt', '<C-\\><C-N>:FloatermToggle split-term<CR>', opts)
|
||||
map('t', '<leader>tf', '<C-\\><C-N>:FloatermToggle floatterm<CR>', opts)
|
||||
--{{{ Terminal mappings
|
||||
|
||||
local programs_map = {
|
||||
gg = { cmd = 'lazygit', display_name = 'lazygit', direction = 'tab', hidden = true },
|
||||
op = { cmd = 'ipython', display_name = 'ipython', direction = 'vertical', hidden = true },
|
||||
oP = { cmd = 'ipython', display_name = 'ipython-full', direction = 'tab', hidden = true },
|
||||
on = { cmd = 'ncmpcpp', display_name = 'ncmpcpp', direction = 'tab', hidden = true },
|
||||
ob = { cmd = 'btop', display_name = 'btop', direction = 'tab', hidden = true },
|
||||
od = { cmd = 'lazydocker', display_name = 'lazydocker', direction = 'tab', hidden = true },
|
||||
}
|
||||
|
||||
for key, value in pairs(programs_map) do
|
||||
map('n', '<leader>' .. key, function()
|
||||
term_toggle(term_factory(value))
|
||||
end, opts)
|
||||
end
|
||||
|
||||
map('v', 'op', '<C-\\><C-N>:ToggleTerm name=ipython')
|
||||
map('v', 'oP', '<C-\\><C-N>:ToggleTerm name=ipython-full')
|
||||
map('t', '<leader>tp', '<C-\\><C-N>:FloatermToggle ipython<CR>', opts)
|
||||
map('t', '<leader>tP', '<C-\\><C-N>:FloatermToggle ipython-full<CR>', opts)
|
||||
map('t', '<space>', '<space>', opts) -- fix space in terminal
|
||||
|
||||
-- LSP mappings
|
||||
map('n', '<C-T>', ':ToggleTerm name=toggleterm<CR>', opts)
|
||||
map('n', '<leader>tt', ':ToggleTerm name=toggleterm<CR>', opts)
|
||||
map('n', '<leader>ts', ':TermSelect<CR>', opts)
|
||||
map('n', '<leader>tv', ':ToggleTerm direction=vertical name=toggleterm-vert<CR>', opts)
|
||||
map('n', '<leader>th', ':ToggleTerm direction=horizontal name=toggleterm-hori<CR>', opts)
|
||||
map('n', '<leader>tf', ':ToggleTerm name=toggleterm<CR>', opts)
|
||||
|
||||
map('t', '<leader>tt', '<C-\\><C-N>:ToggleTerm<CR>', opts)
|
||||
map('t', '<leader>tf', '<C-\\><C-N>:ToggleTerm<CR>', opts)
|
||||
map('t', '<leader>tv', '<C-\\><C-N>:ToggleTerm --name=toggleterm-vert<CR>', opts)
|
||||
map('t', '<leader>th', '<C-\\><C-N>:ToggleTerm --name=toggleterm-hori<CR>', opts)
|
||||
map('t', '<C-T>', '<C-\\><C-n>:Toggleterm<CR>', opts)
|
||||
map('t', '<Esc>', '<C-\\><C-n>', opts)
|
||||
map('t', '<space>', '<space>', opts) -- fix space in terminal
|
||||
--}}}
|
||||
|
||||
--{{{ LSP mappings
|
||||
map('n', 'gA', vim.lsp.buf.code_action, opts)
|
||||
map('n', 'gd', ':Telescope lsp_definitions<CR>', opts)
|
||||
map('n', 'gDc', ':Telescope lsp_implementations<CR>', opts)
|
||||
@ -55,8 +117,10 @@ map('n', 'gl', vim.lsp.codelens.run, opts)
|
||||
map('n', 'gr', ':Telescope lsp_references<CR>', opts)
|
||||
map('n', 'gs', vim.lsp.buf.signature_help, opts)
|
||||
map('n', 'K', vim.lsp.buf.hover, opts)
|
||||
--}}}
|
||||
|
||||
-- Code Companion and Copilot
|
||||
--{{{ Code Companion and Copilot
|
||||
map('n', '<leader>oc', ':CodeCompanionChat<CR>')
|
||||
map('n', '<leader>cc', ':CodeCompanionChat<CR>', opts)
|
||||
map('n', '<leader>ci', ':CodeCompanion ', opts)
|
||||
map('n', '<leader>cp', ':vert Copilot panel<CR>', opts)
|
||||
@ -66,13 +130,26 @@ map('v', '<leader>Ce', ':CodeCompanion /explain<CR>', opts)
|
||||
map('v', '<leader>Cf', ':CodeCompanion /fix<CR>', opts)
|
||||
map('v', '<leader>Cl', ':CodeCompanion /lsp<CR>', opts)
|
||||
map('v', '<leader>CT', ':CodeCompanion /tests<CR>', opts)
|
||||
--}}}
|
||||
|
||||
-- Telescope mappings
|
||||
--{{{ Diagnostics
|
||||
-- nnoremap <leader>cd :Telescope diagnostics<CR>
|
||||
-- nnoremap <leader>cDn :lua vim.diagnostic.goto_next()<CR>
|
||||
-- nnoremap <leader>cDp :lua vim.diagnostic.goto_prev()<CR>
|
||||
-- nnoremap <leader>cl :lua vim.diagnostic.setloclist()<CR>
|
||||
map('n', "<leader>cd", ':Telescope diagnostics<CR>')
|
||||
map('n', "<leader>cDn", ':lua vim.diagnostic.goto_next()<CR>')
|
||||
map('n', "<leader>cDp", ':lua vim.diagnostic.goto_prev()<CR<CR>')
|
||||
map('n', "<leader>cd", ':lua vim.diagnostic.setloclist()<CR>')
|
||||
--}}}
|
||||
|
||||
--{{{ Telescope mappings
|
||||
map('n', '//', ':Telescope current_buffer_fuzzy_find<CR>', opts)
|
||||
map('n', '??', ':Telescope lsp_document_symbols<CR>', opts)
|
||||
map('n', '<leader>fc',
|
||||
':Telescope color_names theme=dropdown layout_config={width=0.45,height=25,prompt_position="bottom"} layout_strategy=vertical<CR>',
|
||||
opts)
|
||||
-- map('n', '<leader>ob', ':Telescope file_browser<CR>')
|
||||
map('n', '<leader>ff', ':Telescope find_files<CR>', opts)
|
||||
map('n', '<leader>sf', ':Telescope find_files<CR>', opts)
|
||||
map('n', '<leader>fg', ':Telescope live_grep<CR>', opts)
|
||||
@ -82,46 +159,56 @@ map('n', '<leader>fG',
|
||||
map('n', '<leader>fb', ':Telescope file_browser<CR>', opts)
|
||||
map('n', '<leader>fr', ':Telescope oldfiles<CR>', opts)
|
||||
|
||||
-- File explorer and tools
|
||||
map('n', '<leader>n', ':NvimTreeToggle<CR>', opts)
|
||||
map('n', '<leader>D', ':Dotenv .env<CR>', opts)
|
||||
|
||||
-- Git mappings
|
||||
map('n', '<leader>gg', ':FloatermNew --title=lazygit --width=1.0 --height=1.0 --opener=vsplit lazygit<CR>', opts)
|
||||
map('n', '<leader>gc', ':Telescope git_commits<CR>', opts)
|
||||
map('n', '<leader>gf', ':Telescope git_files<CR>', opts)
|
||||
|
||||
-- Misc utilities
|
||||
map('n', '<leader>x', '<cmd>!chmod +x %<CR>', opts)
|
||||
map('n', '<leader>y', '"+', opts)
|
||||
map('v', '<leader>y', '"+', opts)
|
||||
|
||||
-- Terminal applications
|
||||
map('n', '<leader>oB', ':FloatermNew --title=btop --opener=vsplit btop<CR>', opts)
|
||||
map('n', '<leader>od', ':FloatermNew --title=lazydocker --opener=vsplit --width=0.75 --height=0.75 lazydocker<CR>', opts)
|
||||
map('n', '<leader>on', ':FloatermNew --title=ncmpcpp --opener=vsplit ncmpcpp --width=1 --height=1<CR>', opts)
|
||||
map('n', '<leader>or', ':FloatermNew --title=ranger --opener=vsplit --width=1.0 --height=1.0 ranger --cmd="cd $PWD"<CR>',
|
||||
opts)
|
||||
|
||||
map('n', "gpc", ':lua require("goto-preview").close_all_win()<CR>')
|
||||
map('n', "gpd", ':lua require("goto-preview").goto_preview_definition()<CR>')
|
||||
map('n', "gpi", ':lua require("goto-preview").goto_preview_implementation()<CR>')
|
||||
|
||||
-- Workspace management
|
||||
map('n', '<leader>wa', vim.lsp.buf.add_workspace_folder, opts)
|
||||
map('n', '<leader>wr', vim.lsp.buf.remove_workspace_folder, opts)
|
||||
map('n', '<leader>wl', function()
|
||||
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
|
||||
end, opts)
|
||||
|
||||
-- Helper
|
||||
--{{{ Telescope Helper
|
||||
map('n', '<leader>hc', ':Telescope commands<CR>')
|
||||
map('n', '<leader>hv', ':Telescope vim_options<CR>')
|
||||
map('n', '<leader>hk', ':Telescope keymaps<CR>')
|
||||
map('n', '<leader>hs', ':Telescope spell_suggest<CR>')
|
||||
map('n', '<leader>hm', ':Telescope man_pages<CR>')
|
||||
--}}}
|
||||
|
||||
-- LSP
|
||||
--{{{ Telescope Search
|
||||
map('n', '<leader>sf', ':Telescope find_files<CR>')
|
||||
map('n', '<leader>sg', ':Telescope live_grep<CR>')
|
||||
map('n', '<leader>sh', ':Telescope command_history<CR>')
|
||||
map('n', '<leader>sm', ':Telescope man_pages<CR>')
|
||||
map('n', '<leader>s/', ':Telescope search_history<CR>')
|
||||
--}}}
|
||||
|
||||
--}}}
|
||||
|
||||
--{{{ File explorer and tools
|
||||
map('n', '<leader>n', ':NvimTreeToggle<CR>', opts)
|
||||
map('n', '<leader>D', ':Dotenv .env<CR>', opts)
|
||||
--}}}
|
||||
|
||||
--{{{ Git mappings
|
||||
map('n', '<leader>gc', ':Telescope git_commits<CR>', opts)
|
||||
map('n', '<leader>gf', ':Telescope git_files<CR>', opts)
|
||||
--}}}
|
||||
|
||||
--{{{ Misc utilities
|
||||
map('n', '<leader>x', '<cmd>!chmod +x %<CR>', opts)
|
||||
map('n', '<leader>y', '"+', opts)
|
||||
map('v', '<leader>y', '"+', opts)
|
||||
map('n', '<leader>sc', ':nohls<CR>')
|
||||
--}}}
|
||||
|
||||
--{{{ Goto Preview
|
||||
map('n', "gpc", ':lua require("goto-preview").close_all_win()<CR>')
|
||||
map('n', "gpd", ':lua require("goto-preview").goto_preview_definition()<CR>')
|
||||
map('n', "gpi", ':lua require("goto-preview").goto_preview_implementation()<CR>')
|
||||
--}}}
|
||||
|
||||
--{{{ Workspace management
|
||||
map('n', '<leader>wa', vim.lsp.buf.add_workspace_folder, opts)
|
||||
map('n', '<leader>wr', vim.lsp.buf.remove_workspace_folder, opts)
|
||||
map('n', '<leader>wl', function()
|
||||
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
|
||||
end, opts)
|
||||
--}}}
|
||||
|
||||
--{{{ LSP
|
||||
map('n', '<leader>ld', ':Telescope lsp_definitions<CR>')
|
||||
map('n', '<leader>lD', ':Telescope diagnostic<CR>')
|
||||
map('n', '<leader>la', ':lua vim.lsp.buf.code_action()<CR>')
|
||||
@ -134,25 +221,4 @@ map('n', '<leader>lR', ':lua vim.lsp.buf.rename()<CR>')
|
||||
map('n', '<leader>ls', ':Telescope lsp_document_symbols<CR>')
|
||||
map('n', '<leader>lt', ':Telescope lsp_type_definitions<CR>')
|
||||
map('n', '<leader>lw', ':Telescope lsp_dynamic_workspace_symbols<CR>')
|
||||
|
||||
|
||||
map('n', '<leader>ob', ':Telescope file_browser<CR>')
|
||||
map('n', '<leader>ot',
|
||||
':FloatermNew --title=floaterm --name=split-term --opener=edit --wintype=vsplit --position=botright --width=0.5<CR>')
|
||||
map('n', '<leader>oh',
|
||||
':FloatermNew --title=floaterm --name=split-term --opener=edit --wintype=split --position=botright --height=0.45<CR>')
|
||||
map('n', '<leader>op',
|
||||
':FloatermNew --title=ipython --name=ipython --opener=split --wintype=vsplit --position=botright --width=0.5 ipython<CR>')
|
||||
map('n', '<leader>oP',
|
||||
':FloatermNew --title=ipython-full --name=ipython-full --opener=edit --width=1.0 --height=1.0 ipython<CR>')
|
||||
|
||||
map('n', '<leader>oc', ':CodeCompanionChat<CR>')
|
||||
map('n', '<leader>of', ':FloatermToggle floatterm<CR>')
|
||||
|
||||
map('n', '<leader>sc', ':nohls<CR>')
|
||||
map('n', '<leader>sf', ':Telescope find_files<CR>')
|
||||
map('n', '<leader>sg', ':Telescope live_grep<CR>')
|
||||
map('n', '<leader>sh', ':Telescope command_history<CR>')
|
||||
map('n', '<leader>sm', ':Telescope man_pages<CR>')
|
||||
map('n', '<leader>s/', ':Telescope search_history<CR>')
|
||||
map('n', '<leader>sc', ':nohls<CR>')
|
||||
--}}}
|
||||
|
@ -27,6 +27,66 @@ require('packer').startup(function(use)
|
||||
-- }}}
|
||||
|
||||
-- LSP/DEV {{{
|
||||
use {
|
||||
"zbirenbaum/copilot.lua",
|
||||
cmd = "Copilot",
|
||||
event = "InsertEnter",
|
||||
config = function()
|
||||
require("copilot").setup({
|
||||
panel = {
|
||||
enabled = true,
|
||||
auto_refresh = false,
|
||||
keymap = {
|
||||
jump_prev = "[[",
|
||||
jump_next = "]]",
|
||||
accept = "<CR>",
|
||||
refresh = "gr",
|
||||
open = "<M-CR>"
|
||||
},
|
||||
layout = {
|
||||
position = "bottom", -- | top | left | right | horizontal | vertical
|
||||
ratio = 0.4
|
||||
},
|
||||
},
|
||||
suggestion = {
|
||||
enabled = false,
|
||||
auto_trigger = false,
|
||||
hide_during_completion = true,
|
||||
debounce = 75,
|
||||
keymap = {
|
||||
accept = "<M-l>",
|
||||
accept_word = false,
|
||||
accept_line = false,
|
||||
next = "<M-]>",
|
||||
prev = "<M-[>",
|
||||
dismiss = "<C-]>",
|
||||
},
|
||||
},
|
||||
-- filetypes = {
|
||||
-- yaml = false,
|
||||
-- markdown = false,
|
||||
-- help = false,
|
||||
-- gitcommit = false,
|
||||
-- gitrebase = false,
|
||||
-- hgcommit = false,
|
||||
-- svn = false,
|
||||
-- cvs = false,
|
||||
-- ["."] = false,
|
||||
-- },
|
||||
copilot_node_command = 'node', -- Node.js version must be > 18.x
|
||||
server_opts_overrides = {
|
||||
trace = "verbose",
|
||||
settings = {
|
||||
advanced = {
|
||||
listCount = 10, -- #completions for panel
|
||||
inlineSuggestCount = 3, -- #completions for getCompletions
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
)
|
||||
end,
|
||||
}
|
||||
use { "zbirenbaum/copilot-cmp" }
|
||||
|
||||
use({
|
||||
@ -66,14 +126,15 @@ require('packer').startup(function(use)
|
||||
use { 'nvimtools/none-ls.nvim' }
|
||||
use { 'neovim/nvim-lspconfig' }
|
||||
use { 'onsails/lspkind-nvim' }
|
||||
use { 'lukas-reineke/lsp-format.nvim' }
|
||||
use {
|
||||
"https://git.sr.ht/~nedia/auto-format.nvim",
|
||||
config = function()
|
||||
require("auto-format").setup()
|
||||
end
|
||||
}
|
||||
use 'mfussenegger/nvim-lint'
|
||||
|
||||
use 'nvim-neotest/nvim-nio'
|
||||
-- use 'mfussenegger/nvim-dap'
|
||||
-- use { "rcarriga/nvim-dap-ui", requires = { "mfussenegger/nvim-dap" } }
|
||||
-- use { 'mfussenegger/nvim-dap-python' }
|
||||
-- use { 'theHamsta/nvim-dap-virtual-text' }
|
||||
|
||||
-- DADBOD {{{
|
||||
|
||||
@ -86,14 +147,17 @@ require('packer').startup(function(use)
|
||||
-- }}}
|
||||
|
||||
-- UI {{{
|
||||
|
||||
use { "akinsho/toggleterm.nvim", tag = '*' }
|
||||
use { 'HiPhish/rainbow-delimiters.nvim' }
|
||||
use {
|
||||
"lukas-reineke/indent-blankline.nvim",
|
||||
config = function()
|
||||
opts = {}
|
||||
-- Other blankline configuration here
|
||||
require("ibl").setup(require("indent-rainbowline").make_opts(opts))
|
||||
end,
|
||||
requires = { "TheGLander/indent-rainbowline.nvim" }
|
||||
-- config = function()
|
||||
-- opts = {}
|
||||
-- -- Other blankline configuration here
|
||||
-- require("ibl").setup(require("indent-rainbowline").make_opts(opts))
|
||||
-- end,
|
||||
-- requires = { "TheGLander/indent-rainbowline.nvim" }
|
||||
}
|
||||
|
||||
use {
|
||||
@ -124,7 +188,6 @@ require('packer').startup(function(use)
|
||||
use { 'lewis6991/gitsigns.nvim' }
|
||||
use { 'rcarriga/nvim-notify' }
|
||||
use { 'stevearc/dressing.nvim' }
|
||||
use { 'HiPhish/rainbow-delimiters.nvim' }
|
||||
use { 'echasnovski/mini.nvim' }
|
||||
|
||||
-- }}}
|
||||
@ -154,7 +217,7 @@ require('packer').startup(function(use)
|
||||
use 'tpope/vim-commentary'
|
||||
use 'tpope/vim-dotenv'
|
||||
use 'tpope/vim-surround'
|
||||
use 'voldikss/vim-floaterm'
|
||||
-- use 'voldikss/vim-floaterm'
|
||||
use 'wakatime/vim-wakatime'
|
||||
use 'rmagatti/goto-preview'
|
||||
|
||||
@ -204,7 +267,6 @@ require('packer').startup(function(use)
|
||||
-- end
|
||||
-- })
|
||||
use { 'olimorris/onedarkpro.nvim' }
|
||||
use { 'projekt0n/github-nvim-theme' }
|
||||
|
||||
use {
|
||||
"catppuccin/nvim",
|
||||
|
@ -1,5 +1,4 @@
|
||||
require('plugins.lsp.copilot-cmp')
|
||||
require('plugins.lsp.lsp-format')
|
||||
require('plugins.lsp.lsp-kind')
|
||||
require('plugins.lsp.lspconfig')
|
||||
-- require('plugins.lsp.lspfuzzy')
|
||||
|
@ -225,9 +225,8 @@ local servers = {
|
||||
|
||||
for _, lsp in ipairs(servers) do
|
||||
if lsp == 'lua_ls' then
|
||||
require("lsp-format").setup {}
|
||||
lspconfig[lsp].setup {
|
||||
on_attach = require("lsp-format").on_attach,
|
||||
-- on_attach = require("lsp-format").on_attach,
|
||||
on_init = function(client)
|
||||
if client.workspace_folders then
|
||||
local path = client.workspace_folders[1].name
|
||||
|
@ -2,7 +2,7 @@ local lualine = require('lualine')
|
||||
lualine.setup({
|
||||
options = {
|
||||
icons_enabled = true,
|
||||
theme = cozynight,
|
||||
theme = 'cozynight',
|
||||
component_separators = { left = '', right = '' },
|
||||
section_separators = { left = '', right = '' },
|
||||
disabled_filetypes = {},
|
||||
|
27
lua/plugins/ui/indent-blankline.lua
Normal file
27
lua/plugins/ui/indent-blankline.lua
Normal file
@ -0,0 +1,27 @@
|
||||
local highlight = {
|
||||
"RainbowRed",
|
||||
"RainbowYellow",
|
||||
"RainbowBlue",
|
||||
"RainbowOrange",
|
||||
"RainbowGreen",
|
||||
"RainbowViolet",
|
||||
"RainbowCyan",
|
||||
}
|
||||
|
||||
local hooks = require "ibl.hooks"
|
||||
-- create the highlight groups in the highlight setup hook, so they are reset
|
||||
-- every time the colorscheme changes
|
||||
hooks.register(hooks.type.HIGHLIGHT_SETUP, function()
|
||||
vim.api.nvim_set_hl(0, "RainbowRed", { fg = "#ED8796" })
|
||||
vim.api.nvim_set_hl(0, "RainbowYellow", { fg = "#EED49F" })
|
||||
vim.api.nvim_set_hl(0, "RainbowBlue", { fg = "#8AADF4" })
|
||||
vim.api.nvim_set_hl(0, "RainbowOrange", { fg = "#F5A97F" })
|
||||
vim.api.nvim_set_hl(0, "RainbowGreen", { fg = "#A6DA95" })
|
||||
vim.api.nvim_set_hl(0, "RainbowViolet", { fg = "#C6A0F6" })
|
||||
vim.api.nvim_set_hl(0, "RainbowCyan", { fg = "#8BD5CA" })
|
||||
end)
|
||||
|
||||
vim.g.rainbow_delimiters = { highlight = highlight }
|
||||
require("ibl").setup { scope = { highlight = highlight } }
|
||||
|
||||
hooks.register(hooks.type.SCOPE_HIGHLIGHT, hooks.builtin.scope_highlight_from_extmark)
|
@ -15,3 +15,5 @@ require('plugins.ui.telescope')
|
||||
require('plugins.ui.treesitter-context')
|
||||
require('plugins.ui.treesitter')
|
||||
require('plugins.ui.whichkey')
|
||||
require('plugins.ui.indent-blankline')
|
||||
require('plugins.ui.toggleterm')
|
||||
|
79
lua/plugins/ui/toggleterm.lua
Normal file
79
lua/plugins/ui/toggleterm.lua
Normal file
@ -0,0 +1,79 @@
|
||||
require("toggleterm").setup {
|
||||
-- size can be a number or function which is passed the current terminal
|
||||
size = function(term)
|
||||
if term.direction == "horizontal" then
|
||||
return 20
|
||||
elseif term.direction == "vertical" then
|
||||
return vim.o.columns * 0.45
|
||||
end
|
||||
end,
|
||||
open_mapping = { [[<c-t>]], [[<leader>tt]] }, -- or { [[<c-\>]], [[<c-¥>]] } if you also use a Japanese keyboard.
|
||||
-- on_create = fun(t: Terminal), -- function to run when the terminal is first created
|
||||
-- on_open = fun(t: Terminal), -- function to run when the terminal opens
|
||||
-- on_close = fun(t: Terminal), -- function to run when the terminal closes
|
||||
-- on_stdout = fun(t: Terminal, job: number, data: string[], name: string) -- callback for processing output on stdout
|
||||
-- on_stderr = fun(t: Terminal, job: number, data: string[], name: string) -- callback for processing output on stderr
|
||||
-- on_exit = fun(t: Terminal, job: number, exit_code: number, name: string) -- function to run when terminal process exits
|
||||
hide_numbers = true, -- hide the number column in toggleterm buffers
|
||||
-- shade_filetypes = {},
|
||||
autochdir = false, -- when neovim changes it current directory the terminal will change it's own when next it's opened
|
||||
highlights = {
|
||||
-- highlights which map to a highlight group name and a table of it's values
|
||||
-- NOTE: this is only a subset of values, any group placed here will be set for the terminal window split
|
||||
Normal = {
|
||||
guibg = "#24273A",
|
||||
},
|
||||
NormalFloat = {
|
||||
link = 'Normal'
|
||||
},
|
||||
-- FloatBorder = {
|
||||
-- guifg = "<VALUE-HERE>",
|
||||
-- guibg = "<VALUE-HERE>",
|
||||
-- },
|
||||
},
|
||||
shade_terminals = false, -- NOTE: this option takes priority over highlights specified so if you specify Normal highlights you should set this to false
|
||||
-- shading_factor = '-10', -- the percentage by which to lighten dark terminal background, default: -30
|
||||
-- shading_ratio = '-3', -- the ratio of shading factor for light/dark terminal background, default: -3
|
||||
start_in_insert = true,
|
||||
insert_mappings = true, -- whether or not the open mapping applies in insert mode
|
||||
terminal_mappings = true, -- whether or not the open mapping applies in the opened terminals
|
||||
persist_size = false,
|
||||
persist_mode = true, -- if set to true (default) the previous terminal mode will be remembered
|
||||
-- direction = 'vertical' | 'horizontal' | 'tab' | 'float',
|
||||
direction = 'float',
|
||||
-- close_on_exit = true, -- close the terminal window when the process exits
|
||||
-- clear_env = false, -- use only environmental variables from `env`, passed to jobstart()
|
||||
-- Change the default shell. Can be a string or a function returning a string
|
||||
shell = vim.o.shell,
|
||||
auto_scroll = true, -- automatically scroll to the bottom on terminal output
|
||||
-- This field is only relevant if direction is set to 'float'
|
||||
float_opts = {
|
||||
-- The border key is *almost* the same as 'nvim_open_win'
|
||||
-- see :h nvim_open_win for details on borders however
|
||||
-- the 'curved' border is a custom border type
|
||||
-- not natively supported but implemented in this plugin.
|
||||
-- border = 'single' | 'double' | 'shadow' | 'curved' | ... other options supported by win open
|
||||
border = 'curved',
|
||||
-- like `size`, width, height, row, and col can be a number or function which is passed the current terminal
|
||||
width = vim.o.columns * 0.8,
|
||||
-- height = 75,
|
||||
-- row = <value>,
|
||||
-- col = vim.o.columns * 0.8,
|
||||
winblend = 3,
|
||||
zindex = 10,
|
||||
-- title_pos = 'left' | 'center' | 'right', position of the title of the floating window
|
||||
title_pos = 'center',
|
||||
},
|
||||
winbar = {
|
||||
enabled = true,
|
||||
name_formatter = function(term) -- term: Terminal
|
||||
return term.name
|
||||
end
|
||||
},
|
||||
responsiveness = {
|
||||
-- breakpoint in terms of `vim.o.columns` at which terminals will start to stack on top of each other
|
||||
-- instead of next to each other
|
||||
-- default = 0 which means the feature is turned off
|
||||
horizontal_breakpoint = 135,
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user