diff --git a/install.sh b/install.sh index 0667e3d..23009d4 100755 --- a/install.sh +++ b/install.sh @@ -1,10 +1,10 @@ -cp alacritty/alacritty.yml ~/.config/alacritty/alacritty.yml +#cp alacritty/alacritty.yml ~/.config/alacritty/alacritty.yml -cp zsh/.zshrc ~/.zshrc +#cp zsh/.zshrc ~/.zshrc -cp i3/config ~/.config/i3/config -cp i3/i3blocks.conf ~/.config/i3/i3blocks.conf +#cp i3/config ~/.config/i3/config +#cp i3/i3blocks.conf ~/.config/i3/i3blocks.conf cp -r nvim/ ~/.config/nvim/ -cp .tmux.conf ~/.tmux.conf +#cp .tmux.conf ~/.tmux.conf diff --git a/nvim/nvim/after_copy/plugin/comment.lua b/nvim/nvim/after_copy/plugin/comment.lua new file mode 100644 index 0000000..9086261 --- /dev/null +++ b/nvim/nvim/after_copy/plugin/comment.lua @@ -0,0 +1 @@ +require("Comment").setup(); diff --git a/nvim/nvim/after_copy/plugin/fugitive.lua b/nvim/nvim/after_copy/plugin/fugitive.lua new file mode 100644 index 0000000..73b78b8 --- /dev/null +++ b/nvim/nvim/after_copy/plugin/fugitive.lua @@ -0,0 +1 @@ +vim.keymap.set("n", "gs", vim.cmd.Git); diff --git a/nvim/nvim/after_copy/plugin/harpoon.lua b/nvim/nvim/after_copy/plugin/harpoon.lua new file mode 100644 index 0000000..9b5f34a --- /dev/null +++ b/nvim/nvim/after_copy/plugin/harpoon.lua @@ -0,0 +1,10 @@ +local mark = require("harpoon.mark") +local ui = require("harpoon.ui") + +vim.keymap.set("n", "a", mark.add_file) +vim.keymap.set("n", "", ui.toggle_quick_menu) + +vim.keymap.set("n", "", function() ui.nav_file(1) end) +vim.keymap.set("n", "", function() ui.nav_file(2) end) +vim.keymap.set("n", "", function() ui.nav_file(3) end) +vim.keymap.set("n", "", function() ui.nav_file(4) end) diff --git a/nvim/nvim/after_copy/plugin/lsp.lua b/nvim/nvim/after_copy/plugin/lsp.lua new file mode 100644 index 0000000..32b483b --- /dev/null +++ b/nvim/nvim/after_copy/plugin/lsp.lua @@ -0,0 +1,90 @@ +-- 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({ + manage_nvim_cmp = { + set_sources = "lsp", + }, +}) + +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({ + ["vws", function() + vim.lsp.buf.workspace_symbol() + end, opts) + vim.keymap.set("n", "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", "vca", function() + vim.lsp.buf.code_action() + end, opts) + vim.keymap.set("n", "vrn", function() + vim.lsp.buf.rename() + end, opts) + vim.keymap.set("i", "", 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 = "", + }, +}) diff --git a/nvim/nvim/after_copy/plugin/lualine.lua b/nvim/nvim/after_copy/plugin/lualine.lua new file mode 100644 index 0000000..215dfd3 --- /dev/null +++ b/nvim/nvim/after_copy/plugin/lualine.lua @@ -0,0 +1,8 @@ +require("lualine").setup({ + options = { + icons_enabled = false, + theme = "onedark", + component_separators = "|", + section_separators = "", + } +}); diff --git a/nvim/nvim/after_copy/plugin/nvimtree.lua b/nvim/nvim/after_copy/plugin/nvimtree.lua new file mode 100644 index 0000000..c6e6a99 --- /dev/null +++ b/nvim/nvim/after_copy/plugin/nvimtree.lua @@ -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 = false, + folder = false, + folder_arrow = false, + git = false, + modified = false, + }, + 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 = {}, + 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 diff --git a/nvim/nvim/after_copy/plugin/telescope.lua b/nvim/nvim/after_copy/plugin/telescope.lua new file mode 100644 index 0000000..3679413 --- /dev/null +++ b/nvim/nvim/after_copy/plugin/telescope.lua @@ -0,0 +1,8 @@ +local builtin = require("telescope.builtin") +vim.keymap.set("n", "pf", builtin.find_files, {}) +vim.keymap.set("n", "", builtin.git_files, {}) +vim.keymap.set("n", "pb", builtin.buffers, {}) +vim.keymap.set("n", "pd", builtin.diagnostics, {}) +vim.keymap.set("n", "ps", function() + builtin.grep_string({ search = vim.fn.input("Grep > ") }) +end) diff --git a/nvim/nvim/after_copy/plugin/treesitter.lua b/nvim/nvim/after_copy/plugin/treesitter.lua new file mode 100644 index 0000000..a4709cc --- /dev/null +++ b/nvim/nvim/after_copy/plugin/treesitter.lua @@ -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 = { "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, + }, +} diff --git a/nvim/nvim/init.lua b/nvim/nvim/init.lua new file mode 100644 index 0000000..9a65128 --- /dev/null +++ b/nvim/nvim/init.lua @@ -0,0 +1 @@ +require("mimu") diff --git a/nvim/nvim/lazy-lock.json b/nvim/nvim/lazy-lock.json new file mode 100644 index 0000000..47d1fdc --- /dev/null +++ b/nvim/nvim/lazy-lock.json @@ -0,0 +1,15 @@ +{ + "Comment.nvim": { "branch": "master", "commit": "0236521ea582747b58869cb72f70ccfa967d2e89" }, + "gitsigns": { "branch": "main", "commit": "3e6e91b09f0468c32d3b96dcacf4b947f037ce25" }, + "harpoon": { "branch": "master", "commit": "ccae1b9bec717ae284906b0bf83d720e59d12b91" }, + "lazy.nvim": { "branch": "main", "commit": "96584866b9c5e998cbae300594d0ccfd0c464627" }, + "lualine.nvim": { "branch": "master", "commit": "566b7036f717f3d676362742630518a47f132fff" }, + "lush": { "branch": "main", "commit": "e8a58f36c256af65cda36878f6f2024a612154c3" }, + "mellifluous.nvim": { "branch": "main", "commit": "d4a52152997907598715d341cad10a4000cf7152" }, + "nvim-tree.lua": { "branch": "master", "commit": "b8c3a23e76f861d5f0ff3f6714b9b56388984d0b" }, + "nvim-treesitter": { "branch": "master", "commit": "8cd2b230174efbf7b5d9f49fe2f90bda6b5eb16e" }, + "plenary": { "branch": "master", "commit": "55d9fe89e33efd26f532ef20223e5f9430c8b0c0" }, + "telescope.nvim": { "branch": "master", "commit": "87e92ea31b2b61d45ad044cf7b2d9b66dad2a618" }, + "trouble.nvim": { "branch": "main", "commit": "f1168feada93c0154ede4d1fe9183bf69bac54ea" }, + "vim-fugitive": { "branch": "master", "commit": "59659093581aad2afacedc81f009ed6a4bfad275" } +} \ No newline at end of file diff --git a/nvim/nvim/lua/mimu/init.lua b/nvim/nvim/lua/mimu/init.lua new file mode 100644 index 0000000..4219cd8 --- /dev/null +++ b/nvim/nvim/lua/mimu/init.lua @@ -0,0 +1,4 @@ +require("mimu.set") +require("mimu.remap") +require("mimu.lazy") + diff --git a/nvim/nvim/lua/mimu/lazy.lua b/nvim/nvim/lua/mimu/lazy.lua new file mode 100644 index 0000000..cc98e71 --- /dev/null +++ b/nvim/nvim/lua/mimu/lazy.lua @@ -0,0 +1,14 @@ +local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" +if not vim.loop.fs_stat(lazypath) then + vim.fn.system({ + "git", + "clone", + "--filter=blob:none", + "https://github.com/folke/lazy.nvim.git", + "--branch=stable", -- latest stable release + lazypath, + }) +end +vim.opt.rtp:prepend(lazypath) + +require("lazy").setup("mimu.plugins") diff --git a/nvim/nvim/lua/mimu/packer.lua b/nvim/nvim/lua/mimu/packer.lua new file mode 100644 index 0000000..7128853 --- /dev/null +++ b/nvim/nvim/lua/mimu/packer.lua @@ -0,0 +1,43 @@ +local fzf_make_cmd = "make" +if vim.loop.os_uname().machine == "arm64" then + plenaryzf_make_cmd = " arch -arm64 make" +end + +local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" +if not vim.loop.fs_stat(lazypath) then + vim.fn.system({ + "git", + "clone", + "--filter=blob:none", + "https://github.com/folke/lazy.nvim.git", + "--branch=stable", -- latest stable release + lazypath, + }) +end +vim.opt.rtp:prepend(lazypath) + +return require("lazy").setup({ + -- LSP + -- { + -- "VonHeikemen/lsp-zero.nvim", + -- branch = "v1.x", + -- dependencies = { + -- -- LSP Support + -- { "neovim/nvim-lspconfig" }, -- Required + -- { "williamboman/mason.nvim" }, -- Optional + -- { "williamboman/mason-lspconfig.nvim" }, -- Optional + -- + -- -- Autocompletion + -- { "hrsh7th/nvim-cmp" }, -- Required + -- { "hrsh7th/cmp-nvim-lsp" }, -- Required + -- { "hrsh7th/cmp-buffer" }, -- Optional + -- { "hrsh7th/cmp-path" }, -- Optional + -- { "saadparwaiz1/cmp_luasnip" }, -- Optional + -- { "hrsh7th/cmp-nvim-lua" }, -- Optional + -- + -- -- Snippets + -- { "L3MON4D3/LuaSnip" }, -- Required + -- { "rafamadriz/friendly-snippets" }, -- Optional + -- }, + -- }, +}) diff --git a/nvim/nvim/lua/mimu/plugins/basics.lua b/nvim/nvim/lua/mimu/plugins/basics.lua new file mode 100644 index 0000000..17022bd --- /dev/null +++ b/nvim/nvim/lua/mimu/plugins/basics.lua @@ -0,0 +1,51 @@ +return { + -- Color scheme + { + "rktjmp/lush.nvim", + name = "lush", + priority = 1000, + }, + + { + "ramojus/mellifluous.nvim", + dependencies = { + "lush" + }, + config = function() + vim.cmd("colorscheme mellifluous") + end, + }, + + -- telescope + { + "nvim-lua/plenary.nvim", + name = "plenary" + }, + + -- trouble / diagnostics + { + "folke/trouble.nvim", + config = function() + require("trouble").setup({ + icons = false, + }) + end + }, + + -- fugitive / git + { + "lewis6991/gitsigns.nvim", + name = "gitsigns", + }, + + -- Comment + { + "numToStr/Comment.nvim", + event = "BufRead", + config = function() + require("Comment").setup() + end + }, + + +} diff --git a/nvim/nvim/lua/mimu/plugins/fugitive.lua b/nvim/nvim/lua/mimu/plugins/fugitive.lua new file mode 100644 index 0000000..f61beca --- /dev/null +++ b/nvim/nvim/lua/mimu/plugins/fugitive.lua @@ -0,0 +1,14 @@ +return { + "tpope/vim-fugitive", + event = { "BufReadPre", "BufNewFile" }, + dependencies = { + "gitsigns" + }, + config = function() + vim.keymap.set("n", "gs", vim.cmd.Git); + + require("gitsigns").setup({ + current_line_blame = true, + }) + end, +} diff --git a/nvim/nvim/lua/mimu/plugins/harpoon.lua b/nvim/nvim/lua/mimu/plugins/harpoon.lua new file mode 100644 index 0000000..1fdee9d --- /dev/null +++ b/nvim/nvim/lua/mimu/plugins/harpoon.lua @@ -0,0 +1,20 @@ +return { + "theprimeagen/harpoon", + event = "BufRead", + dependencies = { + "plenary", + }, + + config = function() + local mark = require("harpoon.mark") + local ui = require("harpoon.ui") + + vim.keymap.set("n", "a", mark.add_file) + vim.keymap.set("n", "", ui.toggle_quick_menu) + + vim.keymap.set("n", "", function() ui.nav_file(1) end) + vim.keymap.set("n", "", function() ui.nav_file(2) end) + vim.keymap.set("n", "", function() ui.nav_file(3) end) + vim.keymap.set("n", "", function() ui.nav_file(4) end) + end +} diff --git a/nvim/nvim/lua/mimu/plugins/lualine.lua b/nvim/nvim/lua/mimu/plugins/lualine.lua new file mode 100644 index 0000000..40680a0 --- /dev/null +++ b/nvim/nvim/lua/mimu/plugins/lualine.lua @@ -0,0 +1,13 @@ +return { + "nvim-lualine/lualine.nvim", + config = function() + require("lualine").setup({ + options = { + icons_enabled = false, + theme = "onedark", + component_separators = "|", + section_separators = "", + } + }); + end +} diff --git a/nvim/nvim/lua/mimu/plugins/nvim-tree.lua b/nvim/nvim/lua/mimu/plugins/nvim-tree.lua new file mode 100644 index 0000000..fa9bc08 --- /dev/null +++ b/nvim/nvim/lua/mimu/plugins/nvim-tree.lua @@ -0,0 +1,243 @@ +return { + { + "nvim-tree/nvim-tree.lua", + config = function() + -- 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({ + 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", + select_prompts = false, + view = { + centralize_selection = false, + cursorline = true, + debounce_delay = 15, + width = 30, + 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 = 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 = false, + folder = false, + folder_arrow = false, + git = false, + modified = false, + }, + 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 = {}, + 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 + }, +} diff --git a/nvim/nvim/lua/mimu/plugins/telescope.lua b/nvim/nvim/lua/mimu/plugins/telescope.lua new file mode 100644 index 0000000..5ac38e5 --- /dev/null +++ b/nvim/nvim/lua/mimu/plugins/telescope.lua @@ -0,0 +1,19 @@ +return { + "nvim-telescope/telescope.nvim", + dependencies = { + "plenary" + }, + + config = function() + local builtin = require("telescope.builtin") + vim.keymap.set("n", "pf", builtin.find_files, {}) + vim.keymap.set("n", "", builtin.git_files, {}) + vim.keymap.set("n", "pb", builtin.buffers, {}) + vim.keymap.set("n", "pd", builtin.diagnostics, {}) + vim.keymap.set("n", "ps", function() + builtin.grep_string({ search = vim.fn.input("Grep > ") }) + end) + end +} + + diff --git a/nvim/nvim/lua/mimu/plugins/treesitter.lua b/nvim/nvim/lua/mimu/plugins/treesitter.lua new file mode 100644 index 0000000..d68d119 --- /dev/null +++ b/nvim/nvim/lua/mimu/plugins/treesitter.lua @@ -0,0 +1,32 @@ +return { + "nvim-treesitter/nvim-treesitter", + event = { "BufReadPost", "BufNewFile" }, + build = function() + require("nvim-treesitter.install").update({ with_sync = true }) + end, + + config = function() + require("nvim-treesitter.configs").setup({ + -- A list of parser names, or "all" (the four listed parsers should always be installed) + ensure_installed = { "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, + }, + }) + end +} diff --git a/nvim/nvim/lua/mimu/remap.lua b/nvim/nvim/lua/mimu/remap.lua new file mode 100644 index 0000000..2435bda --- /dev/null +++ b/nvim/nvim/lua/mimu/remap.lua @@ -0,0 +1,34 @@ +vim.keymap.set("n", "pv", vim.cmd.Ex) + +-- allow to move selected lines up and down +vim.keymap.set("v", "J", ":m '>+1gv=gv") +vim.keymap.set("v", "K", ":m '<-2gv=gv") + +vim.keymap.set("n", "J", "mzJ`z") + +vim.keymap.set("n", "", "zz") +vim.keymap.set("n", "", "zz") + +-- keep search term in the middle +vim.keymap.set("n", "n", "nzzzv") +vim.keymap.set("n", "N", "Nzzzv") + +-- paste without losing the copied stuff +vim.keymap.set("x", "p", "\"_dp") + +-- copy to system clipboard instead of vim +vim.keymap.set("n", "y", "\"+y") +vim.keymap.set("v", "y", "\"+y") +vim.keymap.set("n", "Y", "\"+Y") + +-- quick fix navigation +vim.keymap.set("n", "", "cnextzz") +vim.keymap.set("n", "", "cprevzz") +vim.keymap.set("n", "k", "lnextzz") +vim.keymap.set("n", "j", "lprevzz") + +-- replace in file +vim.keymap.set("n", "s", [[:%s/\<\>//gI]]) + +-- toggle nvim-tree +vim.keymap.set("n", "", "NvimTreeFindFileToggle") diff --git a/nvim/nvim/lua/mimu/set.lua b/nvim/nvim/lua/mimu/set.lua new file mode 100644 index 0000000..211e5a0 --- /dev/null +++ b/nvim/nvim/lua/mimu/set.lua @@ -0,0 +1,27 @@ +vim.cmd [[autocmd BufWritePre lua vim.lsp.buf.format()]] + +vim.opt.nu = true +vim.opt.relativenumber = true + +vim.opt.tabstop = 4 +vim.opt.softtabstop = 4 +vim.opt.shiftwidth = 4 +vim.opt.expandtab = true + +-- highlight search +vim.opt.hlsearch = false +vim.opt.incsearch = true + +vim.opt.termguicolors = true + +vim.opt.scrolloff = 10 +-- vim.opt.signcolumn = "yes" +vim.opt.isfname:append("@-@") + +vim.opt.updatetime = 50 + +vim.opt.colorcolumn = "120" + +vim.g.mapleader = " " + +vim.o.cmdheight = 0 diff --git a/update.sh b/update.sh index 65c49d0..54fbaa4 100755 --- a/update.sh +++ b/update.sh @@ -1,10 +1,10 @@ -cp ~/.config/alacritty/alacritty.yml alacritty/alacritty.yml +#cp ~/.config/alacritty/alacritty.yml alacritty/alacritty.yml -cp ~/.zshrc zsh/.zshrc - -cp ~/.config/i3/config i3/config -cp ~/.config/i3/i3blocks.conf i3/i3blocks.conf +# cp ~/.zshrc zsh/.zshrc +# +# cp ~/.config/i3/config i3/config +# cp ~/.config/i3/i3blocks.conf i3/i3blocks.conf cp -r ~/.config/nvim/ nvim/ -cp ~/.tmux.conf .tmux.conf +# cp ~/.tmux.conf .tmux.conf