missing files
This commit is contained in:
parent
ac3f869b1d
commit
0e899fe8ed
|
@ -0,0 +1,27 @@
|
|||
return {
|
||||
'ThePrimeagen/harpoon',
|
||||
config = function()
|
||||
local mark = require("harpoon.mark")
|
||||
local ui = require("harpoon.ui")
|
||||
|
||||
vim.keymap.set('n', "<leader>aa", mark.add_file, { desc = 'add file to list' })
|
||||
vim.keymap.set('n', "<leader>al", ui.toggle_quick_menu, { desc = 'quick list' })
|
||||
vim.keymap.set('n', "<leader>ap", ui.nav_prev)
|
||||
vim.keymap.set('n', "<leader>an", ui.nav_next)
|
||||
|
||||
vim.keymap.set('n', "<C-n>", function()
|
||||
ui.nav_file(1)
|
||||
end)
|
||||
vim.keymap.set('n', "<C-m>", function()
|
||||
ui.nav_file(2)
|
||||
end)
|
||||
|
||||
vim.keymap.set('n', "<C-,>", function()
|
||||
ui.nav_file(3)
|
||||
end)
|
||||
|
||||
vim.keymap.set('n', "<C-.>", function()
|
||||
ui.nav_file(4)
|
||||
end)
|
||||
end,
|
||||
}
|
|
@ -0,0 +1,49 @@
|
|||
-- You can add your own plugins here or in other files in this directory!
|
||||
-- I promise not to create any merge conflicts in this directory :)
|
||||
--
|
||||
-- See the kickstart.nvim README for more information
|
||||
|
||||
vim.opt.guicursor =
|
||||
"n-v-c:block,i-ci-ve:ver25,r-cr:hor20,o:hor50,a:blinkwait700-blinkoff400-blinkon250-Cursor/lCursor,sm:block-blinkwait175-blinkoff150-blinkon175"
|
||||
|
||||
-- vim.opt.guicursor = ""
|
||||
|
||||
vim.opt.tabstop = 4
|
||||
vim.opt.softtabstop = 4
|
||||
vim.opt.shiftwidth = 4
|
||||
vim.opt.expandtab = true
|
||||
|
||||
vim.opt.smartindent = true
|
||||
vim.opt.wrap = false
|
||||
|
||||
vim.opt.swapfile = false
|
||||
vim.opt.backup = false
|
||||
vim.opt.undodir = os.getenv("HOME") .. "/.vim/undodir"
|
||||
vim.opt.undofile = true
|
||||
|
||||
-- vim.opt.hlsearch = false
|
||||
vim.opt.incsearch = true
|
||||
|
||||
vim.opt.termguicolors = true
|
||||
|
||||
vim.opt.scrolloff = 8
|
||||
vim.opt.signcolumn = "yes"
|
||||
-- vim.opt.isfname:append("@_@")
|
||||
|
||||
vim.opt.colorcolumn = "80"
|
||||
|
||||
vim.opt.showtabline = 2
|
||||
|
||||
function my_tabline()
|
||||
local s = ''
|
||||
for i = 1, vim.fn.tabpagenr('$') do
|
||||
local bufnr = vim.fn.tabpagebuflist(i)[vim.fn.tabpagewinnr(i)]
|
||||
local bufname = vim.fn.fnamemodify(vim.fn.bufname(bufnr), ':p')
|
||||
s = s .. '%' .. i .. 'T' .. (bufnr == vim.fn.bufnr('%') and '%1*' or '%2*') .. bufname .. ' '
|
||||
end
|
||||
return s
|
||||
end
|
||||
|
||||
vim.o.tabline = [[%!v:lua.my_tabline()]]
|
||||
|
||||
return {}
|
|
@ -0,0 +1,32 @@
|
|||
vim.keymap.set('n', '<leader>w', '<Cmd>w<CR>', { desc = 'Write file' })
|
||||
vim.keymap.set('n', '<C-h>', '<C-w>h', { desc = 'Window left' })
|
||||
vim.keymap.set('n', '<C-l>', '<C-w>l', { desc = 'Window right' })
|
||||
vim.keymap.set('n', '<C-j>', '<C-w>j', { desc = 'Window down' })
|
||||
vim.keymap.set('n', '<C-k>', '<C-w>k', { desc = 'Window up' })
|
||||
|
||||
vim.keymap.set('i', '<C-h>', '<Left>', { desc = 'Move left' })
|
||||
vim.keymap.set('i', '<C-l>', '<Right>', { desc = 'Move right' })
|
||||
|
||||
vim.keymap.set('n', '<leader>c', '<Cmd>q<CR>', { desc = 'Move right' })
|
||||
|
||||
vim.keymap.set('n', '<A-j>', ":m .+1<CR>==")
|
||||
vim.keymap.set('n', '<A-k>', ":m .-2<CR>==")
|
||||
|
||||
vim.keymap.set('i', '<A-k>', "<Esc>:m .-2<CR>==gi")
|
||||
vim.keymap.set('i', '<A-j>', "<Esc>:m .+1<CR>==gi")
|
||||
|
||||
vim.keymap.set('v', '<A-j>', ":m '>+1<CR>gv-gv")
|
||||
vim.keymap.set('v', '<A-k>', ":m '<-2<CR>gv-gv")
|
||||
|
||||
vim.keymap.set('n', 'J', "mzJ`z")
|
||||
|
||||
vim.keymap.set('n', '<C-d>', '<C-d>zz')
|
||||
vim.keymap.set('n', '<C-u>', '<C-u>zz')
|
||||
|
||||
vim.keymap.set('n', 'n', 'nzzzv')
|
||||
vim.keymap.set('n', 'N', 'Nzzzv')
|
||||
|
||||
vim.keymap.set('x', '<leader>p', "\"_dP")
|
||||
|
||||
|
||||
return {}
|
|
@ -0,0 +1,10 @@
|
|||
vim.g.neoformat_try_node_exe = 1
|
||||
|
||||
vim.api.nvim_create_autocmd("BufWritePre", {
|
||||
pattern = { "*.json", "*.jsonc", "*.js", "*.ts", "*.tsx", "*.jsx" },
|
||||
command = "silent Neoformat prettier",
|
||||
})
|
||||
|
||||
return {
|
||||
"sbdchd/neoformat",
|
||||
}
|
|
@ -0,0 +1,226 @@
|
|||
-- disable netrw at the very start of your init.lua
|
||||
vim.g.loaded_netrw = 1
|
||||
vim.g.loaded_netrwPlugin = 1
|
||||
|
||||
-- set termguicolors to enable highlight groups
|
||||
vim.opt.termguicolors = true
|
||||
|
||||
vim.keymap.set('n', '<leader>e', '<Cmd>NvimTreeToggle<CR>')
|
||||
|
||||
|
||||
function on_text_search()
|
||||
local api = require("nvim-tree.api")
|
||||
local node = api.tree.get_node_under_cursor()
|
||||
|
||||
vim.cmd("Telescope live_grep search_dirs=" .. node.absolute_path)
|
||||
end
|
||||
|
||||
function folder_search(bufnr)
|
||||
local api = require("nvim-tree.api")
|
||||
api.config.mappings.default_on_attach(bufnr)
|
||||
|
||||
vim.api.nvim_buf_set_keymap(
|
||||
bufnr,
|
||||
"n",
|
||||
"<Space>st",
|
||||
"<cmd>lua on_text_search()<CR>",
|
||||
{ silent = false, nowait = true }
|
||||
)
|
||||
end
|
||||
|
||||
function NvimTreeWidth()
|
||||
local winwidth = vim.fn.winwidth(0)
|
||||
if winwidth <= 100 then
|
||||
return 30
|
||||
elseif winwidth <= 200 then
|
||||
return 40
|
||||
else
|
||||
return 50
|
||||
end
|
||||
end
|
||||
|
||||
return {
|
||||
'nvim-tree/nvim-tree.lua',
|
||||
dependencies = {
|
||||
'nvim-tree/nvim-web-devicons'
|
||||
},
|
||||
opts = {
|
||||
on_attach = folder_search,
|
||||
|
||||
auto_reload_on_write = false,
|
||||
disable_netrw = false,
|
||||
hijack_cursor = false,
|
||||
hijack_netrw = true,
|
||||
hijack_unnamed_buffer_when_opening = false,
|
||||
sort_by = "name",
|
||||
root_dirs = {},
|
||||
prefer_startup_root = false,
|
||||
sync_root_with_cwd = true,
|
||||
reload_on_bufenter = false,
|
||||
respect_buf_cwd = false,
|
||||
select_prompts = false,
|
||||
view = {
|
||||
adaptive_size = false,
|
||||
centralize_selection = true,
|
||||
width = NvimTreeWidth(),
|
||||
hide_root_folder = false,
|
||||
side = "left",
|
||||
preserve_window_proportions = false,
|
||||
number = false,
|
||||
relativenumber = false,
|
||||
signcolumn = "yes",
|
||||
float = {
|
||||
enable = false,
|
||||
quit_on_focus_loss = true,
|
||||
open_win_config = {
|
||||
relative = "editor",
|
||||
border = "rounded",
|
||||
width = 30,
|
||||
height = 30,
|
||||
row = 1,
|
||||
col = 1,
|
||||
},
|
||||
},
|
||||
},
|
||||
renderer = {
|
||||
add_trailing = false,
|
||||
group_empty = false,
|
||||
highlight_git = true,
|
||||
full_name = false,
|
||||
highlight_opened_files = "none",
|
||||
root_folder_label = ":t",
|
||||
indent_width = 2,
|
||||
indent_markers = {
|
||||
enable = false,
|
||||
inline_arrows = true,
|
||||
icons = {
|
||||
corner = "└",
|
||||
edge = "│",
|
||||
item = "│",
|
||||
none = " ",
|
||||
},
|
||||
},
|
||||
special_files = { "Cargo.toml", "Makefile", "README.md", "readme.md" },
|
||||
symlink_destination = true,
|
||||
},
|
||||
hijack_directories = {
|
||||
enable = false,
|
||||
auto_open = true,
|
||||
},
|
||||
update_focused_file = {
|
||||
enable = true,
|
||||
debounce_delay = 15,
|
||||
update_root = true,
|
||||
ignore_list = {},
|
||||
},
|
||||
-- diagnostics = {
|
||||
-- enable = lvim.use_icons,
|
||||
-- show_on_dirs = false,
|
||||
-- show_on_open_dirs = true,
|
||||
-- debounce_delay = 50,
|
||||
-- severity = {
|
||||
-- min = vim.diagnostic.severity.HINT,
|
||||
-- max = vim.diagnostic.severity.ERROR,
|
||||
-- },
|
||||
-- icons = {
|
||||
-- hint = lvim.icons.diagnostics.BoldHint,
|
||||
-- info = lvim.icons.diagnostics.BoldInformation,
|
||||
-- warning = lvim.icons.diagnostics.BoldWarning,
|
||||
-- error = lvim.icons.diagnostics.BoldError,
|
||||
-- },
|
||||
-- },
|
||||
filters = {
|
||||
dotfiles = false,
|
||||
git_clean = false,
|
||||
no_buffer = false,
|
||||
-- custom = { "node_modules", "\\.cache" },
|
||||
custom = { "\\.cache" },
|
||||
exclude = {},
|
||||
},
|
||||
filesystem_watchers = {
|
||||
enable = true,
|
||||
debounce_delay = 50,
|
||||
ignore_dirs = {},
|
||||
},
|
||||
git = {
|
||||
enable = true,
|
||||
ignore = false,
|
||||
show_on_dirs = true,
|
||||
show_on_open_dirs = true,
|
||||
timeout = 200,
|
||||
},
|
||||
actions = {
|
||||
use_system_clipboard = true,
|
||||
change_dir = {
|
||||
enable = true,
|
||||
global = false,
|
||||
restrict_above_cwd = false,
|
||||
},
|
||||
expand_all = {
|
||||
max_folder_discovery = 300,
|
||||
exclude = {},
|
||||
},
|
||||
file_popup = {
|
||||
open_win_config = {
|
||||
col = 1,
|
||||
row = 1,
|
||||
relative = "cursor",
|
||||
border = "shadow",
|
||||
style = "minimal",
|
||||
},
|
||||
},
|
||||
open_file = {
|
||||
quit_on_open = false,
|
||||
resize_window = false,
|
||||
window_picker = {
|
||||
enable = true,
|
||||
picker = "default",
|
||||
chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890",
|
||||
exclude = {
|
||||
filetype = { "notify", "lazy", "qf", "diff", "fugitive", "fugitiveblame" },
|
||||
buftype = { "nofile", "terminal", "help" },
|
||||
},
|
||||
},
|
||||
},
|
||||
remove_file = {
|
||||
close_window = true,
|
||||
},
|
||||
},
|
||||
trash = {
|
||||
cmd = "trash",
|
||||
require_confirm = true,
|
||||
},
|
||||
live_filter = {
|
||||
prefix = "[FILTER]: ",
|
||||
always_show_folders = true,
|
||||
},
|
||||
tab = {
|
||||
sync = {
|
||||
open = false,
|
||||
close = false,
|
||||
ignore = {},
|
||||
},
|
||||
},
|
||||
notify = {
|
||||
threshold = vim.log.levels.INFO,
|
||||
},
|
||||
log = {
|
||||
enable = false,
|
||||
truncate = false,
|
||||
types = {
|
||||
all = false,
|
||||
config = false,
|
||||
copy_paste = false,
|
||||
dev = false,
|
||||
diagnostics = false,
|
||||
git = false,
|
||||
profile = false,
|
||||
watcher = false,
|
||||
},
|
||||
},
|
||||
system_open = {
|
||||
cmd = nil,
|
||||
args = {},
|
||||
},
|
||||
},
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
vim.keymap.set('n', '<leader>u', vim.cmd.UndotreeToggle)
|
||||
|
||||
return {
|
||||
'mbbill/undotree'
|
||||
}
|
|
@ -0,0 +1,74 @@
|
|||
-- autoformat.lua
|
||||
--
|
||||
-- Use your language server to automatically format your code on save.
|
||||
-- Adds additional commands as well to manage the behavior
|
||||
|
||||
return {
|
||||
'neovim/nvim-lspconfig',
|
||||
config = function()
|
||||
-- Switch for controlling whether you want autoformatting.
|
||||
-- Use :KickstartFormatToggle to toggle autoformatting on or off
|
||||
local format_is_enabled = true
|
||||
vim.api.nvim_create_user_command('KickstartFormatToggle', function()
|
||||
format_is_enabled = not format_is_enabled
|
||||
print('Setting autoformatting to: ' .. tostring(format_is_enabled))
|
||||
end, {})
|
||||
|
||||
-- Create an augroup that is used for managing our formatting autocmds.
|
||||
-- We need one augroup per client to make sure that multiple clients
|
||||
-- can attach to the same buffer without interfering with each other.
|
||||
local _augroups = {}
|
||||
local get_augroup = function(client)
|
||||
if not _augroups[client.id] then
|
||||
local group_name = 'kickstart-lsp-format-' .. client.name
|
||||
local id = vim.api.nvim_create_augroup(group_name, { clear = true })
|
||||
_augroups[client.id] = id
|
||||
end
|
||||
|
||||
return _augroups[client.id]
|
||||
end
|
||||
|
||||
-- Whenever an LSP attaches to a buffer, we will run this function.
|
||||
--
|
||||
-- See `:help LspAttach` for more information about this autocmd event.
|
||||
vim.api.nvim_create_autocmd('LspAttach', {
|
||||
group = vim.api.nvim_create_augroup('kickstart-lsp-attach-format', { clear = true }),
|
||||
-- This is where we attach the autoformatting for reasonable clients
|
||||
callback = function(args)
|
||||
local client_id = args.data.client_id
|
||||
local client = vim.lsp.get_client_by_id(client_id)
|
||||
local bufnr = args.buf
|
||||
|
||||
-- Only attach to clients that support document formatting
|
||||
if not client.server_capabilities.documentFormattingProvider then
|
||||
return
|
||||
end
|
||||
|
||||
-- Tsserver usually works poorly. Sorry you work with bad languages
|
||||
-- You can remove this line if you know what you're doing :)
|
||||
if client.name == 'tsserver' then
|
||||
return
|
||||
end
|
||||
|
||||
-- Create an autocmd that will run *before* we save the buffer.
|
||||
-- Run the formatting command for the LSP that has just attached.
|
||||
vim.api.nvim_create_autocmd('BufWritePre', {
|
||||
group = get_augroup(client),
|
||||
buffer = bufnr,
|
||||
callback = function()
|
||||
if not format_is_enabled then
|
||||
return
|
||||
end
|
||||
|
||||
vim.lsp.buf.format {
|
||||
async = false,
|
||||
filter = function(c)
|
||||
return c.id == client.id
|
||||
end,
|
||||
}
|
||||
end,
|
||||
})
|
||||
end,
|
||||
})
|
||||
end,
|
||||
}
|
|
@ -0,0 +1,87 @@
|
|||
-- debug.lua
|
||||
--
|
||||
-- Shows how to use the DAP plugin to debug your code.
|
||||
--
|
||||
-- Primarily focused on configuring the debugger for Go, but can
|
||||
-- be extended to other languages as well. That's why it's called
|
||||
-- kickstart.nvim and not kitchen-sink.nvim ;)
|
||||
|
||||
return {
|
||||
-- NOTE: Yes, you can install new plugins here!
|
||||
'mfussenegger/nvim-dap',
|
||||
-- NOTE: And you can specify dependencies as well
|
||||
dependencies = {
|
||||
-- Creates a beautiful debugger UI
|
||||
'rcarriga/nvim-dap-ui',
|
||||
|
||||
-- Installs the debug adapters for you
|
||||
'williamboman/mason.nvim',
|
||||
'jay-babu/mason-nvim-dap.nvim',
|
||||
|
||||
-- Add your own debuggers here
|
||||
'leoluz/nvim-dap-go',
|
||||
},
|
||||
config = function()
|
||||
local dap = require 'dap'
|
||||
local dapui = require 'dapui'
|
||||
|
||||
require('mason-nvim-dap').setup {
|
||||
-- Makes a best effort to setup the various debuggers with
|
||||
-- reasonable debug configurations
|
||||
automatic_setup = true,
|
||||
|
||||
-- You can provide additional configuration to the handlers,
|
||||
-- see mason-nvim-dap README for more information
|
||||
handlers = {},
|
||||
|
||||
-- You'll need to check that you have the required things installed
|
||||
-- online, please don't ask me how to install them :)
|
||||
ensure_installed = {
|
||||
-- Update this to ensure that you have the debuggers for the langs you want
|
||||
'delve',
|
||||
},
|
||||
}
|
||||
|
||||
-- Basic debugging keymaps, feel free to change to your liking!
|
||||
vim.keymap.set('n', '<F5>', dap.continue, { desc = 'Debug: Start/Continue' })
|
||||
vim.keymap.set('n', '<F1>', dap.step_into, { desc = 'Debug: Step Into' })
|
||||
vim.keymap.set('n', '<F2>', dap.step_over, { desc = 'Debug: Step Over' })
|
||||
vim.keymap.set('n', '<F3>', dap.step_out, { desc = 'Debug: Step Out' })
|
||||
vim.keymap.set('n', '<leader>b', dap.toggle_breakpoint, { desc = 'Debug: Toggle Breakpoint' })
|
||||
vim.keymap.set('n', '<leader>B', function()
|
||||
dap.set_breakpoint(vim.fn.input 'Breakpoint condition: ')
|
||||
end, { desc = 'Debug: Set Breakpoint' })
|
||||
|
||||
-- Dap UI setup
|
||||
-- For more information, see |:help nvim-dap-ui|
|
||||
dapui.setup {
|
||||
-- Set icons to characters that are more likely to work in every terminal.
|
||||
-- Feel free to remove or use ones that you like more! :)
|
||||
-- Don't feel like these are good choices.
|
||||
icons = { expanded = '▾', collapsed = '▸', current_frame = '*' },
|
||||
controls = {
|
||||
icons = {
|
||||
pause = '⏸',
|
||||
play = '▶',
|
||||
step_into = '⏎',
|
||||
step_over = '⏭',
|
||||
step_out = '⏮',
|
||||
step_back = 'b',
|
||||
run_last = '▶▶',
|
||||
terminate = '⏹',
|
||||
disconnect = '⏏',
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
-- Toggle to see last session result. Without this, you can't see session output in case of unhandled exception.
|
||||
vim.keymap.set('n', '<F7>', dapui.toggle, { desc = 'Debug: See last session result.' })
|
||||
|
||||
dap.listeners.after.event_initialized['dapui_config'] = dapui.open
|
||||
dap.listeners.before.event_terminated['dapui_config'] = dapui.close
|
||||
dap.listeners.before.event_exited['dapui_config'] = dapui.close
|
||||
|
||||
-- Install golang specific config
|
||||
require('dap-go').setup()
|
||||
end,
|
||||
}
|
Loading…
Reference in New Issue