working version after update
This commit is contained in:
parent
a963cb7284
commit
00ed47465d
17 changed files with 288 additions and 158 deletions
|
|
@ -1,9 +1,7 @@
|
|||
require('conform').setup {
|
||||
formatters_by_ft = {
|
||||
lua = { 'stylua' },
|
||||
-- Conform will run multiple formatters sequentially
|
||||
python = { 'isort', 'black' },
|
||||
-- Use a sub-list to run only the first available formatter
|
||||
javascript = { { 'prettierd', 'prettier' } },
|
||||
javascriptreact = { { 'prettier' } },
|
||||
typescriptreact = { { 'prettier' } },
|
||||
|
|
|
|||
|
|
@ -4,11 +4,29 @@ local lsp = require 'lsp-zero'
|
|||
lsp.preset 'recommended'
|
||||
|
||||
lsp.ensure_installed {
|
||||
'gopls',
|
||||
'pyright',
|
||||
'tsserver',
|
||||
'rust_analyzer',
|
||||
-- Python
|
||||
-- 'mypy',
|
||||
-- 'black',
|
||||
-- 'isort',
|
||||
'ruff_lsp',
|
||||
'pyright',
|
||||
-- Java Stuffs
|
||||
'jdtls',
|
||||
-- 'google-java-format',
|
||||
-- Golang
|
||||
-- 'gofumpt',
|
||||
-- 'goimports-reviser',
|
||||
-- 'golines',
|
||||
'gopls',
|
||||
'templ',
|
||||
'htmx',
|
||||
-- Typescript
|
||||
-- 'prettier',
|
||||
-- 'prettierd',
|
||||
'tsserver',
|
||||
-- Others
|
||||
'tailwindcss',
|
||||
}
|
||||
|
||||
-- Fix Undefined global 'vim'
|
||||
|
|
|
|||
115
after/plugin/neo-tree.lua
Normal file
115
after/plugin/neo-tree.lua
Normal file
|
|
@ -0,0 +1,115 @@
|
|||
require("neo-tree").setup({
|
||||
cmd = "Neotree",
|
||||
keys = {
|
||||
{
|
||||
"<leader>o",
|
||||
function()
|
||||
if vim.bo.filetype == "neo-tree" then
|
||||
vim.cmd.wincmd "p"
|
||||
else
|
||||
vim.cmd.Neotree "focus"
|
||||
end
|
||||
end,
|
||||
desc = "Toggle Explorer Focus"
|
||||
},
|
||||
{ "<C-n>", "<cmd>Neotree toggle<cr>", desc = "Toggle Explorer" }
|
||||
},
|
||||
init = function() vim.g.neo_tree_remove_legacy_commands = true end,
|
||||
|
||||
opts = {
|
||||
auto_clean_after_session_restore = true,
|
||||
close_if_last_window = true,
|
||||
source_selector = {
|
||||
winbar = true,
|
||||
content_layout = "center",
|
||||
},
|
||||
commands = {
|
||||
parent_or_close = function(state)
|
||||
local node = state.tree:get_node()
|
||||
if (node.type == "directory" or node:has_children()) and node:is_expanded() then
|
||||
state.commands.toggle_node(state)
|
||||
else
|
||||
require("neo-tree.ui.renderer").focus_node(state, node:get_parent_id())
|
||||
end
|
||||
end,
|
||||
child_or_open = function(state)
|
||||
local node = state.tree:get_node()
|
||||
if node.type == "directory" or node:has_children() then
|
||||
if not node:is_expanded() then -- if unexpanded, expand
|
||||
state.commands.toggle_node(state)
|
||||
else -- if expanded and has children, seleect the next child
|
||||
require("neo-tree.ui.renderer").focus_node(state, node:get_child_ids()[1])
|
||||
end
|
||||
else -- if not a directory just open it
|
||||
state.commands.open(state)
|
||||
end
|
||||
end,
|
||||
copy_selector = function(state)
|
||||
local node = state.tree:get_node()
|
||||
local filepath = node:get_id()
|
||||
local filename = node.name
|
||||
local modify = vim.fn.fnamemodify
|
||||
|
||||
local results = {
|
||||
e = { val = modify(filename, ":e"), msg = "Extension only" },
|
||||
f = { val = filename, msg = "Filename" },
|
||||
F = { val = modify(filename, ":r"), msg = "Filename w/o extension" },
|
||||
h = { val = modify(filepath, ":~"), msg = "Path relative to Home" },
|
||||
p = { val = modify(filepath, ":."), msg = "Path relative to CWD" },
|
||||
P = { val = filepath, msg = "Absolute path" },
|
||||
}
|
||||
|
||||
local messages = {
|
||||
{ "\nChoose to copy to clipboard:\n", "Normal" },
|
||||
}
|
||||
for i, result in pairs(results) do
|
||||
if result.val and result.val ~= "" then
|
||||
vim.list_extend(messages, {
|
||||
{ ("%s."):format(i), "Identifier" },
|
||||
{ (" %s: "):format(result.msg) },
|
||||
{ result.val, "String" },
|
||||
{ "\n" },
|
||||
})
|
||||
end
|
||||
end
|
||||
vim.api.nvim_echo(messages, false, {})
|
||||
local result = results[vim.fn.getcharstr()]
|
||||
if result and result.val and result.val ~= "" then
|
||||
vim.notify("Copied: " .. result.val)
|
||||
vim.fn.setreg("+", result.val)
|
||||
end
|
||||
end,
|
||||
},
|
||||
window = {
|
||||
width = 30,
|
||||
mappings = {
|
||||
["<space>"] = false, -- disable space until we figure out which-key disabling
|
||||
["[b"] = "prev_source",
|
||||
["]b"] = "next_source",
|
||||
o = "open",
|
||||
--[[ O = "system_open", ]]
|
||||
h = "parent_or_close",
|
||||
l = "child_or_open",
|
||||
Y = "copy_selector",
|
||||
},
|
||||
},
|
||||
filesystem = {
|
||||
hijack_netrw_behavior = "open_current",
|
||||
use_libuv_file_watcher = true,
|
||||
follow_current_file = {
|
||||
enabled = true, -- This will find and focus the file in the active buffer every time
|
||||
-- -- the current file is changed while the tree is open.
|
||||
leave_dirs_open = false, -- `false` closes auto expanded dirs, such as with `:Neotree reveal`
|
||||
},
|
||||
},
|
||||
event_handlers = {
|
||||
{
|
||||
event = "neo_tree_buffer_enter",
|
||||
handler = function(_)
|
||||
vim.opt_local.signcolumn = "auto"
|
||||
-- require("neo-tree").close_all()
|
||||
end,
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
17
after/plugin/tailwind-config.lua
Normal file
17
after/plugin/tailwind-config.lua
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
require('tailwind-tools').setup {
|
||||
document_color = {
|
||||
enabled = true, -- can be toggled by commands
|
||||
kind = 'inline', -- "inline" | "foreground" | "background"
|
||||
inline_symbol = ' ', -- only used in inline mode
|
||||
debounce = 200, -- in milliseconds, only applied in insert mode
|
||||
},
|
||||
conceal = {
|
||||
enabled = false, -- can be toggled by commands
|
||||
min_length = nil, -- only conceal classes exceeding the provided length
|
||||
symbol = '', -- only a single character is allowed
|
||||
highlight = { -- extmark highlight options, see :h 'highlight'
|
||||
fg = '#38BDF8',
|
||||
},
|
||||
},
|
||||
custom_filetypes = {}, -- see the extension section to learn how it works
|
||||
}
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
-- document existing key chains
|
||||
require('which-key').register({
|
||||
--[[ ['<leader>c'] = { name = '[C]ode', _ = 'which_key_ignore' },
|
||||
['<leader>d'] = { name = '[D]ocument', _ = 'which_key_ignore' },
|
||||
['<leader>g'] = { name = '[G]it', _ = 'which_key_ignore' },
|
||||
['<leader>h'] = { name = 'More git', _ = 'which_key_ignore' },
|
||||
['<leader>r'] = { name = '[R]ename', _ = 'which_key_ignore' },
|
||||
['<leader>s'] = { name = '[S]earch', _ = 'which_key_ignore' }, ]]
|
||||
['<leader>w'] = { name = '[W]orkspace', _ = 'which_key_ignore' },
|
||||
})
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue