From ba8bd22858cea30726a6c487d1901151aae87ba1 Mon Sep 17 00:00:00 2001 From: Andre Herniques Date: Mon, 12 Jun 2023 13:18:07 +0100 Subject: [PATCH] added readme --- README.md | 32 ++++ after/plugin/colors.lua | 376 ++++++++++++++++++++-------------------- lua/andr3/lsp.lua | 2 +- 3 files changed, 221 insertions(+), 189 deletions(-) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..68c1b67 --- /dev/null +++ b/README.md @@ -0,0 +1,32 @@ +# My NeoVim configuration + +## Requirements + - NeoVim + - [Packer](https://github.com/wbthomason/packer.nvim) + +To install packer run +```bash +git clone --depth 1 https://github.com/wbthomason/packer.nvim ~/.local/share/nvim/site/pack/packer/start/packer.nvim +``` + +To run LSP (autocomplete) you will also need the server for that language. +Currently, the languages servers that are configured are: + - bash (bashls) + - c/c++ (ccls) + - prisma (prismals) + - python (pylsp) + - rust (rust_analyzer) + - svelte (sveltelsp) + - tex (ltex) + - ts (tsserver) + - vlang (vls) + - zig (zls) + +## Some useful shortcuts + - ' f': Find files uses fuzzy finding to search for files in the folder you are currently are + - ' /': Search the files using grep + - '': Open file structure + - 'gd': Goto definition + - 'K': Show call signature + - ']d': Goto next error + - '[d': Goto previous error diff --git a/after/plugin/colors.lua b/after/plugin/colors.lua index dc6aeb6..90ec7a7 100644 --- a/after/plugin/colors.lua +++ b/after/plugin/colors.lua @@ -12,11 +12,11 @@ vim.opt.background = 'dark' -- vim.g.cyberpunk_cursorline='black' -- vim.cmd('colorscheme ayu') --- vim.cmd('colorscheme night_owl_light') +vim.cmd('colorscheme night_owl_light') -- vim.cmd('colorscheme eva01') -- vim.cmd('colorscheme cyberpunk') -- vim.cmd('colorscheme catppuccin-latte') -vim.cmd('colorscheme oxocarbon') +-- vim.cmd('colorscheme oxocarbon') -- examples for your init.lua @@ -26,211 +26,211 @@ vim.g.loaded_netrwPlugin = 1 -- setup with some options require("nvim-tree").setup{ -- BEGIN_DEFAULT_OPTS -auto_reload_on_write = true, -create_in_closed_folder = false, -disable_netrw = false, -hijack_cursor = false, -hijack_netrw = true, -hijack_unnamed_buffer_when_opening = false, -ignore_buffer_on_setup = false, -open_on_setup = false, -open_on_setup_file = false, -open_on_tab = false, -ignore_buf_on_tab_change = {}, -sort_by = "name", -root_dirs = {}, -prefer_startup_root = false, -sync_root_with_cwd = false, -reload_on_bufenter = false, -respect_buf_cwd = false, -on_attach = "disable", -remove_keymaps = false, -select_prompts = false, -view = { - adaptive_size = false, - centralize_selection = false, - 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 + auto_reload_on_write = true, + create_in_closed_folder = false, + disable_netrw = false, + hijack_cursor = false, + hijack_netrw = true, + hijack_unnamed_buffer_when_opening = false, + ignore_buffer_on_setup = false, + open_on_setup = false, + open_on_setup_file = false, + open_on_tab = false, + ignore_buf_on_tab_change = {}, + sort_by = "name", + root_dirs = {}, + prefer_startup_root = false, + sync_root_with_cwd = false, + reload_on_bufenter = false, + respect_buf_cwd = false, + on_attach = "disable", + remove_keymaps = false, + select_prompts = false, + view = { + adaptive_size = false, + centralize_selection = false, + 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, + }, }, }, - 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 = false, + full_name = false, + highlight_opened_files = "none", + root_folder_modifier = ":~", + indent_width = 2, + indent_markers = { + enable = false, + inline_arrows = true, + icons = { + corner = "└", + edge = "│", + item = "│", + bottom = "─", + none = " ", + }, }, - }, -}, -renderer = { - add_trailing = false, - group_empty = false, - highlight_git = false, - full_name = false, - highlight_opened_files = "none", - root_folder_modifier = ":~", - indent_width = 2, - indent_markers = { - enable = false, - inline_arrows = true, icons = { - corner = "└", - edge = "│", - item = "│", - bottom = "─", - none = " ", - }, - }, - icons = { - webdev_colors = true, - git_placement = "before", - padding = " ", - symlink_arrow = " ➛ ", - show = { - file = true, - folder = true, - folder_arrow = true, - git = true, - }, - glyphs = { - default = "", - symlink = "", - bookmark = "", - folder = { - arrow_closed = "", - arrow_open = "", - default = "", - open = "", - empty = "", - empty_open = "", - symlink = "", - symlink_open = "", + webdev_colors = true, + git_placement = "before", + padding = " ", + symlink_arrow = " ➛ ", + show = { + file = true, + folder = true, + folder_arrow = true, + git = true, }, - git = { - unstaged = "🙄", - staged = "🥺", - unmerged = "🫢", - renamed = "📛", - untracked = "💫", - deleted = "🗑️", - ignored = "🤷", + glyphs = { + default = "", + symlink = "", + bookmark = "", + 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, }, - 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 = {}, -}, -ignore_ft_on_setup = {}, -system_open = { - cmd = "", - args = {}, -}, -diagnostics = { - enable = true, - show_on_dirs = false, - debounce_delay = 50, - icons = { error = "☣️ ", warning = "😞", hint = "❤️ ", info = "ℹ️ " } -, -}, -filters = { - dotfiles = false, - custom = {}, - exclude = {}, -}, -filesystem_watchers = { - enable = true, - debounce_delay = 50, -}, -git = { - enable = true, - ignore = true, - show_on_dirs = true, - timeout = 400, -}, -actions = { - use_system_clipboard = true, - change_dir = { + hijack_directories = { enable = true, - global = false, - restrict_above_cwd = false, + auto_open = true, }, - expand_all = { - max_folder_discovery = 300, + update_focused_file = { + enable = false, + update_root = false, + ignore_list = {}, + }, + ignore_ft_on_setup = {}, + system_open = { + cmd = "", + args = {}, + }, + diagnostics = { + enable = true, + show_on_dirs = false, + debounce_delay = 50, + icons = { error = "☣️ ", warning = "😞", hint = "❤️ ", info = "ℹ️ " } + , + }, + filters = { + dotfiles = false, + custom = {}, exclude = {}, }, - file_popup = { - open_win_config = { - col = 1, - row = 1, - relative = "cursor", - border = "shadow", - style = "minimal", - }, + filesystem_watchers = { + enable = true, + debounce_delay = 50, }, - open_file = { - quit_on_open = false, - resize_window = true, - window_picker = { + git = { + enable = true, + ignore = true, + show_on_dirs = true, + timeout = 400, + }, + actions = { + use_system_clipboard = true, + change_dir = { enable = true, - chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890", - exclude = { - filetype = { "notify", "packer", "qf", "diff", "fugitive", "fugitiveblame" }, - buftype = { "nofile", "terminal", "help" }, + 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, + chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890", + exclude = { + filetype = { "notify", "packer", "qf", "diff", "fugitive", "fugitiveblame" }, + buftype = { "nofile", "terminal", "help" }, + }, + }, + }, + remove_file = { + close_window = true, + }, }, - remove_file = { - close_window = true, + trash = { + cmd = "gio trash", + require_confirm = true, }, -}, -trash = { - cmd = "gio trash", - require_confirm = true, -}, -live_filter = { - prefix = "[FILTER]: ", - always_show_folders = true, -}, -log = { - enable = false, - truncate = false, - types = { - all = false, - config = false, - copy_paste = false, - dev = false, - diagnostics = false, - git = false, - profile = false, - watcher = false, + live_filter = { + prefix = "[FILTER]: ", + always_show_folders = true, }, -}, -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, + }, + }, + notify = { + threshold = vim.log.levels.INFO, + }, +} diff --git a/lua/andr3/lsp.lua b/lua/andr3/lsp.lua index 91aaa53..269c89c 100644 --- a/lua/andr3/lsp.lua +++ b/lua/andr3/lsp.lua @@ -194,7 +194,7 @@ keymap("n", "]E", function() require("lspsaga.diagnostic").goto_next({ severity = vim.diagnostic.severity.ERROR }) end, { silent = true }) -keymap("n","o", "LSoutlineToggle",{ silent = true }) +-- keymap("n","o", "LSoutlineToggle",{ silent = true }) keymap("n", "K", "Lspsaga hover_doc", { silent = true }) keymap("n", "", "Lspsaga open_floaterm", { silent = true }) keymap("n", "", "Lspsaga open_floaterm lazygit", { silent = true })