update file structure
This commit is contained in:
@@ -0,0 +1,61 @@
|
||||
require("claude-code").setup({
|
||||
-- Terminal window settings
|
||||
window = {
|
||||
split_ratio = 0.3, -- Percentage of screen for the terminal window (height for horizontal, width for vertical splits)
|
||||
position = "botright", -- Position of the window: "botright", "topleft", "vertical", "float", etc.
|
||||
enter_insert = true, -- Whether to enter insert mode when opening Claude Code
|
||||
hide_numbers = true, -- Hide line numbers in the terminal window
|
||||
hide_signcolumn = true, -- Hide the sign column in the terminal window
|
||||
|
||||
-- Floating window configuration (only applies when position = "float")
|
||||
float = {
|
||||
width = "80%", -- Width: number of columns or percentage string
|
||||
height = "80%", -- Height: number of rows or percentage string
|
||||
row = "center", -- Row position: number, "center", or percentage string
|
||||
col = "center", -- Column position: number, "center", or percentage string
|
||||
relative = "editor", -- Relative to: "editor" or "cursor"
|
||||
border = "rounded", -- Border style: "none", "single", "double", "rounded", "solid", "shadow"
|
||||
},
|
||||
},
|
||||
-- File refresh settings
|
||||
refresh = {
|
||||
enable = true, -- Enable file change detection
|
||||
updatetime = 100, -- updatetime when Claude Code is active (milliseconds)
|
||||
timer_interval = 1000, -- How often to check for file changes (milliseconds)
|
||||
show_notifications = true, -- Show notification when files are reloaded
|
||||
},
|
||||
-- Git project settings
|
||||
git = {
|
||||
use_git_root = true, -- Set CWD to git root when opening Claude Code (if in git project)
|
||||
},
|
||||
-- Shell-specific settings
|
||||
shell = {
|
||||
separator = '&&', -- Command separator used in shell commands
|
||||
pushd_cmd = 'pushd', -- Command to push directory onto stack (e.g., 'pushd' for bash/zsh, 'enter' for nushell)
|
||||
popd_cmd = 'popd', -- Command to pop directory from stack (e.g., 'popd' for bash/zsh, 'exit' for nushell)
|
||||
},
|
||||
-- Command settings
|
||||
command = "claude", -- Command used to launch Claude Code
|
||||
-- Command variants
|
||||
command_variants = {
|
||||
-- Conversation management
|
||||
continue = "--continue", -- Resume the most recent conversation
|
||||
resume = "--resume", -- Display an interactive conversation picker
|
||||
|
||||
-- Output options
|
||||
verbose = "--verbose", -- Enable verbose logging with full turn-by-turn output
|
||||
},
|
||||
-- Keymaps
|
||||
keymaps = {
|
||||
toggle = {
|
||||
normal = "<C-,>", -- Normal mode keymap for toggling Claude Code, false to disable
|
||||
terminal = "<C-,>", -- Terminal mode keymap for toggling Claude Code, false to disable
|
||||
variants = {
|
||||
continue = "<leader>cC", -- Normal mode keymap for Claude Code with continue flag
|
||||
verbose = "<leader>cV", -- Normal mode keymap for Claude Code with verbose flag
|
||||
},
|
||||
},
|
||||
window_navigation = true, -- Enable window navigation keymaps (<C-h/j/k/l>)
|
||||
scrolling = true, -- Enable scrolling keymaps (<C-f/b>) for page up/down
|
||||
}
|
||||
})
|
||||
@@ -0,0 +1,47 @@
|
||||
local cmp = require'cmp'
|
||||
|
||||
cmp.setup({
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
vim.snippet.expand(args.body)
|
||||
end,
|
||||
},
|
||||
window = {
|
||||
completion = cmp.config.window.bordered(),
|
||||
documentation = cmp.config.window.bordered(),
|
||||
},
|
||||
mapping = {
|
||||
['<Tab>'] = function(fallback)
|
||||
if cmp.visible() then
|
||||
if not cmp.select_next_item() then
|
||||
if vim.bo.buftype ~= 'prompt' and has_words_before() then
|
||||
cmp.complete()
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end
|
||||
else
|
||||
return vim.cmd(">")
|
||||
end
|
||||
end,
|
||||
|
||||
['<S-Tab>'] = function(fallback)
|
||||
if cmp.visible() then
|
||||
if not cmp.select_prev_item() then
|
||||
if vim.bo.buftype ~= 'prompt' and has_words_before() then
|
||||
cmp.complete()
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end
|
||||
else
|
||||
return vim.cmd("<")
|
||||
end
|
||||
end,
|
||||
['<CR>'] = cmp.mapping.confirm({ select = true }),
|
||||
},
|
||||
sources = cmp.config.sources({
|
||||
{ name = 'nvim_lsp' },
|
||||
{ name = 'buffer' },
|
||||
})
|
||||
})
|
||||
@@ -0,0 +1,14 @@
|
||||
require('gruvbox').setup({
|
||||
priority = 1000,
|
||||
|
||||
config = true,
|
||||
|
||||
contrast = "hard",
|
||||
transparent_mode = true,
|
||||
overrides = {
|
||||
NonText = { fg = "#666666" },
|
||||
},
|
||||
})
|
||||
|
||||
-- Colorscheme
|
||||
vim.cmd("colorscheme gruvbox")
|
||||
@@ -0,0 +1,35 @@
|
||||
local levels = vim.diagnostic.severity
|
||||
|
||||
local opts = {
|
||||
virtual_text = false,
|
||||
float = {
|
||||
border = "rounded",
|
||||
},
|
||||
signs = {
|
||||
text = {
|
||||
[levels.ERROR] = '✘',
|
||||
[levels.WARN] = '▲',
|
||||
[levels.HINT] = '⚑',
|
||||
[levels.INFO] = '»',
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
local sign_define = function(name, text)
|
||||
local hl = 'DiagnosticSign' .. name
|
||||
vim.fn.sign_define(hl, {
|
||||
texthl = hl,
|
||||
text = text,
|
||||
numhl = ''
|
||||
})
|
||||
end
|
||||
|
||||
if vim.fn.has('nvim-0.10') == 0 then
|
||||
sign_define('Error', opts.signs.text[levels.ERROR])
|
||||
sign_define('Warn', opts.signs.text[levels.WARN])
|
||||
sign_define('Hint', opts.signs.text[levels.HINT])
|
||||
sign_define('Info', opts.signs.text[levels.INFO])
|
||||
end
|
||||
|
||||
vim.cmd [[autocmd CursorHold,CursorHoldI * lua vim.diagnostic.open_float(nil, {focus=false})]]
|
||||
vim.diagnostic.config(opts)
|
||||
@@ -0,0 +1,9 @@
|
||||
require('gitsigns').setup({
|
||||
current_line_blame = true,
|
||||
current_line_blame_opts = {
|
||||
virt_text = true,
|
||||
virt_text_pos = 'eol', -- 'eol' | 'overlay' | 'right_align'
|
||||
delay = 0,
|
||||
ignore_whitespace = false,
|
||||
},
|
||||
})
|
||||
@@ -0,0 +1,12 @@
|
||||
vim.cmd [[highlight IndentBlanklineColor guifg=#555555 gui=nocombine]]
|
||||
|
||||
local highlights = {
|
||||
"CursorColumn",
|
||||
"Whitespace",
|
||||
}
|
||||
|
||||
require('ibl').setup({
|
||||
indent = {
|
||||
highlight = highlight,
|
||||
}
|
||||
})
|
||||
@@ -0,0 +1,12 @@
|
||||
require('plugins.colorscheme')
|
||||
require('plugins.diagnostics')
|
||||
require('plugins.gitsigns')
|
||||
require('plugins.indent-blankline')
|
||||
require('plugins.nvim-autopairs')
|
||||
require('plugins.nvim-tree')
|
||||
require('plugins.telescope')
|
||||
require('plugins.treesitter')
|
||||
require('plugins.cmp')
|
||||
require('plugins.render-markdown')
|
||||
require('plugins.mason')
|
||||
require('plugins.claude')
|
||||
@@ -0,0 +1,16 @@
|
||||
require('mason').setup({})
|
||||
require('mason-lspconfig').setup({
|
||||
ensure_installed = {
|
||||
'lua_ls',
|
||||
'ts_ls',
|
||||
'html',
|
||||
'cssls',
|
||||
'jsonls',
|
||||
'pylsp',
|
||||
},
|
||||
handlers = {
|
||||
function(server_name)
|
||||
require('lspconfig')[server_name].setup({})
|
||||
end,
|
||||
},
|
||||
})
|
||||
@@ -0,0 +1,4 @@
|
||||
require('nvim-autopairs').setup({
|
||||
event = "InsertEnter",
|
||||
config = true
|
||||
})
|
||||
@@ -0,0 +1,33 @@
|
||||
local function custom_mapping(bufnr)
|
||||
local api = require("nvim-tree.api")
|
||||
|
||||
local function opts(desc)
|
||||
return {
|
||||
desc = "nvim-tree: " .. desc,
|
||||
buffer = bufnr,
|
||||
noremap = true,
|
||||
silent = true,
|
||||
nowait = true
|
||||
}
|
||||
end
|
||||
|
||||
-- default mappings
|
||||
api.config.mappings.default_on_attach(bufnr)
|
||||
|
||||
-- custom mappings
|
||||
vim.keymap.set('n', 's', api.node.open.vertical, opts('Open: Vertical Split'))
|
||||
vim.keymap.set('n', 'u', api.node.navigate.parent_close, opts('Close Directory'))
|
||||
end
|
||||
|
||||
require("nvim-tree").setup({
|
||||
view = {
|
||||
width = {},
|
||||
},
|
||||
on_attach = custom_mapping,
|
||||
})
|
||||
|
||||
-- Tree
|
||||
vim.keymap.set("n", [[<C-\>]], ":NvimTreeToggle<CR>")
|
||||
vim.keymap.set("n", [[<leader>\]], ":NvimTreeToggle<CR>")
|
||||
vim.keymap.set("n", "<leader>ff", ":NvimTreeFindFile<CR>")
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
require('render-markdown').setup({
|
||||
completions = {
|
||||
lsp = {
|
||||
enabled = true,
|
||||
}
|
||||
},
|
||||
heading = {
|
||||
backgrounds = { '' },
|
||||
},
|
||||
})
|
||||
@@ -0,0 +1,10 @@
|
||||
require('telescope').setup({})
|
||||
|
||||
-- Telescope
|
||||
local builtin = require("telescope.builtin")
|
||||
|
||||
vim.keymap.set("n", "<leader>gf", builtin.git_files)
|
||||
vim.keymap.set("n", "<leader>gs", builtin.git_status)
|
||||
vim.keymap.set("n", "<leader>gg", builtin.live_grep)
|
||||
vim.keymap.set("n", "<leader>b", builtin.buffers)
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
require('nvim-treesitter.configs').setup({
|
||||
branch = "main",
|
||||
ensure_installed = {
|
||||
"bash",
|
||||
"css",
|
||||
"graphql",
|
||||
"html",
|
||||
"javascript",
|
||||
"jsdoc",
|
||||
"json",
|
||||
"lua",
|
||||
"markdown",
|
||||
"markdown_inline",
|
||||
"python",
|
||||
"query",
|
||||
"regex",
|
||||
"scss",
|
||||
"svelte",
|
||||
"tmux",
|
||||
"tsx",
|
||||
"typescript",
|
||||
"vim",
|
||||
"vimdoc",
|
||||
"yaml",
|
||||
},
|
||||
sync_install = false,
|
||||
highlight = {
|
||||
enable = true,
|
||||
},
|
||||
indent = {
|
||||
enable = true,
|
||||
},
|
||||
})
|
||||
Reference in New Issue
Block a user