add tmux, nvim

This commit is contained in:
brice
2023-05-08 10:21:18 +02:00
parent 8fa029e08d
commit 854172eba9
20 changed files with 841 additions and 7 deletions
+1
View File
@@ -0,0 +1 @@
require("Comment").setup();
+1
View File
@@ -0,0 +1 @@
vim.keymap.set("n", "<leader>gs", vim.cmd.Git);
+10
View File
@@ -0,0 +1,10 @@
local mark = require("harpoon.mark")
local ui = require("harpoon.ui")
vim.keymap.set("n", "<leader>a", mark.add_file)
vim.keymap.set("n", "<C-e>", ui.toggle_quick_menu)
vim.keymap.set("n", "<C-h>", function() ui.nav_file(1) end)
vim.keymap.set("n", "<C-t>", function() ui.nav_file(2) end)
vim.keymap.set("n", "<C-n>", function() ui.nav_file(3) end)
vim.keymap.set("n", "<C-s>", function() ui.nav_file(4) end)
+63
View File
@@ -0,0 +1,63 @@
-- Learn the keybindings, see :help lsp-zero-keybindings
-- Learn to configure LSP servers, see :help lsp-zero-api-showcase
local lsp = require('lsp-zero')
lsp.preset('recommended')
lsp.ensure_installed({
"tsserver",
"eslint",
"lua_ls",
"rust_analyzer",
"gopls",
})
local cmp = require("cmp")
local cmp_select = { behaviour = cmp.SelectBehavior.Select }
local cmp_mappings = lsp.defaults.cmp_mappings({
["<C-p"] = cmp.mapping.select_prev_item(cmp_select),
["<C-n"] = cmp.mapping.select_next_item(cmp_select),
["<C-y"] = cmp.mapping.confirm({ select = true }),
["<C-Space"] = cmp.mapping.complete(),
})
lsp.set_preferences({
sign_icons = { },
})
lsp.setup_nvim_cmp({
mapping = cmp_mappings,
})
lsp.on_attach(function(client, bufnr)
local opts = { buffer = bufnr, remap = false }
vim.keymap.set("n", "gd", function() vim.lsp.buf.definition() end, opts)
vim.keymap.set("n", "gr", function() vim.lsp.buf.references() end, opts)
vim.keymap.set("n", "K", function() vim.lsp.buf.hover() end, opts)
vim.keymap.set("n", "<leader>vws", function() vim.lsp.buf.workspace_symbol() end, opts)
vim.keymap.set("n", "<leader>vd", function() vim.lsp.diagnostic.open_float() end, opts)
vim.keymap.set("n", "[d", function() vim.lsp.diagnostic.goto_next() end, opts)
vim.keymap.set("n", "]d", function() vim.lsp.diagnostic.goto_prev() end, opts)
vim.keymap.set("n", "<leader>vca", function() vim.lsp.buf.code_action() end, opts)
vim.keymap.set("n", "<leader>vrn", function() vim.lsp.buf.rename() end, opts)
vim.keymap.set("i", "<C-h>", function() vim.lsp.buf.signature_help() end, opts)
end)
lsp.setup()
vim.diagnostic.config({
virtual_text = true,
signs = false,
update_in_insert = false,
underline = true,
severity_sort = true,
float = {
focusable = false,
style = 'minimal',
border = 'rounded',
source = 'always',
header = '',
prefix = '',
},
});
+8
View File
@@ -0,0 +1,8 @@
require("lualine").setup({
options = {
icons_enabled = false,
theme = "onedark",
component_separators = "|",
section_separators = "",
}
});
+246
View File
@@ -0,0 +1,246 @@
local nvimtree = require('nvim-tree')
-- disable netrw at the very start of your init.lua (strongly advised)
vim.g.loaded_netrw = 1
vim.g.loaded_netrwPlugin = 1
require("nvim-tree").setup { -- BEGIN_DEFAULT_OPTS
auto_reload_on_write = true,
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 = false,
reload_on_bufenter = false,
respect_buf_cwd = true,
on_attach = "default",
remove_keymaps = false,
select_prompts = false,
view = {
centralize_selection = false,
cursorline = true,
debounce_delay = 15,
width = 30,
hide_root_folder = false,
side = "left",
preserve_window_proportions = false,
number = false,
relativenumber = false,
signcolumn = "yes",
mappings = {
custom_only = false,
list = {
-- user mappings go here
},
},
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 = true,
highlight_git = false,
full_name = false,
highlight_opened_files = "none",
highlight_modified = "none",
root_folder_label = ":~:s?$?/..?",
indent_width = 2,
indent_markers = {
enable = false,
inline_arrows = true,
icons = {
corner = "└",
edge = "│",
item = "│",
bottom = "─",
none = " ",
},
},
icons = {
webdev_colors = false,
git_placement = "before",
modified_placement = "after",
padding = " ",
symlink_arrow = " ➛ ",
show = {
file = true,
folder = true,
folder_arrow = true,
git = true,
modified = true,
},
glyphs = {
default = " ",
symlink = " ",
bookmark = " ",
modified = "●",
folder = {
arrow_closed = " ",
arrow_open = " ",
default = " ",
open = " ",
empty = " ",
empty_open = " ",
symlink = " ",
symlink_open = " ",
},
git = {
unstaged = "✗",
staged = "✓",
unmerged = "",
renamed = "➜",
untracked = "★",
deleted = "",
ignored = "◌",
},
},
},
special_files = { "Cargo.toml", "Makefile", "README.md", "readme.md" },
symlink_destination = true,
},
hijack_directories = {
enable = true,
auto_open = true,
},
update_focused_file = {
enable = false,
update_root = false,
ignore_list = {},
},
system_open = {
cmd = "",
args = {},
},
diagnostics = {
enable = false,
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 = "",
info = "",
warning = "",
error = "",
},
},
filters = {
dotfiles = false,
git_clean = false,
no_buffer = false,
custom = {},
exclude = {},
},
filesystem_watchers = {
enable = true,
debounce_delay = 50,
ignore_dirs = {},
},
git = {
enable = false,
ignore = true,
show_on_dirs = true,
show_on_open_dirs = true,
timeout = 400,
},
modified = {
enable = false,
show_on_dirs = true,
show_on_open_dirs = true,
},
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 = true,
window_picker = {
enable = true,
picker = "default",
chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890",
exclude = {
filetype = { "notify", "packer", "qf", "diff", "fugitive", "fugitiveblame" },
buftype = { "nofile", "terminal", "help" },
},
},
},
remove_file = {
close_window = true,
},
},
trash = {
cmd = "gio trash",
},
live_filter = {
prefix = "[FILTER]: ",
always_show_folders = true,
},
tab = {
sync = {
open = false,
close = false,
ignore = {},
},
},
notify = {
threshold = vim.log.levels.INFO,
},
ui = {
confirm = {
remove = true,
trash = true,
},
},
experimental = {
git = {
async = true,
},
},
log = {
enable = false,
truncate = false,
types = {
all = false,
config = false,
copy_paste = false,
dev = false,
diagnostics = false,
git = false,
profile = false,
watcher = false,
},
},
} -- END_DEFAULT_OPTS
+6
View File
@@ -0,0 +1,6 @@
local builtin = require('telescope.builtin')
vim.keymap.set('n', '<leader>pf', builtin.find_files, {})
vim.keymap.set('n', '<C-p', builtin.git_files, {})
vim.keymap.set('n', '<leader>ps', function()
builtin.grep_string({ search = vim.fn.input("Grep > ")});
end)
+22
View File
@@ -0,0 +1,22 @@
require'nvim-treesitter.configs'.setup {
-- A list of parser names, or "all" (the four listed parsers should always be installed)
ensure_installed = { "help", "javascript", "typescript", "c", "lua", "vim", "rust", "go" },
-- Install parsers synchronously (only applied to `ensure_installed`)
sync_install = false,
-- Automatically install missing parsers when entering buffer
-- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally
auto_install = true,
highlight = {
-- `false` will disable the whole extension
enable = true,
-- Setting this to true will run `:h syntax` and tree-sitter at the same time.
-- Set this to `true` if you depend on 'syntax' being enabled (like for indentation).
-- Using this option may slow down your editor, and you may see some duplicate highlights.
-- Instead of true it can also be a list of languages
additional_vim_regex_highlighting = false,
},
}
+1
View File
@@ -0,0 +1 @@
vim.keymap.set("n", "<leader>u", vim.cmd.UndotreeToggle)