mirror of
https://github.com/boxpositron/absolute-vim.git
synced 2026-02-28 11:40:36 +00:00
feat: add support for Jedi-Vim plugin
- Add configuration for Jedi-Vim plugin in `lua/absolute/plugins/jedi.lua` - Create `lua/absolute/after/jedi.lua` to set Jedi-Vim mappings and options fix: fix lualine theme and add custom section - Update `lua/absolute/after/lualine.lua` to fix the lualine theme configuration - Add a custom section to display the Poetv status line in lualine feat: add keybindings for Poetv plugin - Add keybindings for activating and deactivating virtualenv in `lua/absolute/after/poet-v.lua` fix: fix remap keybindings - Update `lua/absolute/remap.lua` to fix and improve remap keybindings feat: add alternate escape keybinding - Add keybinding to use <C-c> as an alternate escape key in insert mode fix: disable Q keybinding - Disable the Q keybinding to prevent accidentally entering Ex mode feat: add keybinding for formatting document with LSP Formatter - Add keybinding to format the document using the LSP Formatter feat: add keybindings for navigation quick fixes - Add keybindings for navigating through quick fixes in the location list and the quickfix list feat: add keybinding for regex replace - Add keybinding to perform a regex replace in the entire file feat: add keybinding for sourcing file - Add keybinding to source the current file feat: add keybinding for toggling TMUX pane - Add keybinding to toggle the TMUX pane using MaximizerToggle command
This commit is contained in:
10
lua/absolute/after/jedi.lua
Normal file
10
lua/absolute/after/jedi.lua
Normal file
@@ -0,0 +1,10 @@
|
||||
vim.g["jedi#goto_command"] = "" -- "<leader>d"
|
||||
vim.g["jedi#goto_assignments_command"] = "<leader>gD"
|
||||
vim.g["jedi#goto_stubs_command"] = "" -- "<leader>s"
|
||||
vim.g["jedi#goto_definitions_command"] = "gd"
|
||||
vim.g["jedi#documentation_command"] = "K"
|
||||
vim.g["jedi#usages_command"] = "<leader>n"
|
||||
vim.g["jedi#completions_command"] = "<C-Space>"
|
||||
vim.g["jedi#rename_command"] = "<leader>rn"
|
||||
vim.g["jedi#rename_command_keep_name"] = "" -- "<leader>R"
|
||||
|
||||
@@ -45,6 +45,34 @@ local my_lualine_theme = {
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
function GetPoetvStatusLine()
|
||||
-- Get the poetv statusline
|
||||
-- If poetv is not active, return empty string
|
||||
|
||||
if IsPoetvActive() then
|
||||
local poetv_name = vim.g.poetv_name
|
||||
local poetv_statusline_symbol = vim.g.poetv_statusline_symbol
|
||||
|
||||
local result = string.sub(poetv_name, 1, 20) .. " " .. poetv_statusline_symbol
|
||||
|
||||
return result
|
||||
else
|
||||
return ""
|
||||
end
|
||||
end
|
||||
|
||||
function IsPoetvActive()
|
||||
-- Check if vim.g.poetv_name exists
|
||||
-- If it does, then poetv is active
|
||||
|
||||
if vim.g.poetv_name ~= nil then
|
||||
return true
|
||||
else
|
||||
return false
|
||||
end
|
||||
end
|
||||
|
||||
-- configure lualine with modified theme
|
||||
lualine.setup({
|
||||
options = {
|
||||
@@ -52,6 +80,11 @@ lualine.setup({
|
||||
},
|
||||
sections = {
|
||||
lualine_x = {
|
||||
{
|
||||
GetPoetvStatusLine,
|
||||
cond = IsPoetvActive,
|
||||
color = { fg = "#ff9e64" },
|
||||
},
|
||||
{
|
||||
lazy_status.updates,
|
||||
cond = lazy_status.has_updates,
|
||||
|
||||
@@ -2,3 +2,16 @@ vim.g.poetv_executables = { "poetry", "pipenv" }
|
||||
vim.g.poetv_auto_activate = 1
|
||||
vim.g.poetv_set_environment = 1
|
||||
vim.g.poetv_statusline_symbol = "🐍"
|
||||
|
||||
|
||||
-- Keybindings
|
||||
|
||||
local opts = { noremap = true, silent = true }
|
||||
|
||||
-- Poetv: Activate Virtualenv
|
||||
opts.desc = "Poetv: Activate virtualenv"
|
||||
vim.keymap.set("n", "<leader>pva", "<cmd>PoetvActivate<CR>", opts)
|
||||
|
||||
-- Poetv: Deactivate Virtualenv
|
||||
opts.desc = "Poetv: Deactivate virtualenv"
|
||||
vim.keymap.set("n", "<leader>pvd", "<cmd>PoetvDeactivate<CR>", opts)
|
||||
|
||||
Reference in New Issue
Block a user