--[[ GENERAL VIM CONFIG --]] vim.opt.termguicolors = true vim.opt.relativenumber = true vim.o.guifont = "FiraCode Nerd Font Mono:h20" --[[ GENERAL LVIM CONFIG --]] lvim.use_icons = true lvim.colorscheme = "tokyonight" lvim.log.level = "warn" lvim.transparent_window = false lvim.format_on_save = { enabled = true } -- Disable virtual text lvim.lsp.diagnostics.virtual_text = false -- to disable icons and use a minimalist setup set this as false lvim.use_icons = true --[[ KEYMAPS --]] lvim.leader = "space" lvim.keys.normal_mode[""] = ":w" lvim.keys.normal_mode[""] = ":q" -- or vim.keymap.set("n", "", ":q" ) lvim.keys.normal_mode[""] = false lvim.keys.normal_mode[""] = ":BufferLineCycleNext" lvim.keys.normal_mode[""] = ":BufferLineCyclePrev" lvim.keys.normal_mode[""] = ":NvimTreeToggle" -- WhichKey Keymaps lvim.builtin.which_key.mappings["c"] = { ":let @/ = \"\"", "Clear search" } lvim.builtin.which_key.mappings["d"] = { ":bprevious:bdelete #", "Close bufferline tab" } lvim.builtin.which_key.mappings["bc"] = { ":BufferKill", "Close buffer" } lvim.builtin.which_key.mappings["gP"] = { ":Git pull", "Git pull" } lvim.builtin.which_key.mappings["f"] = { ":Telescope find_files", "Find files" } lvim.builtin.which_key.mappings["sg"] = { ":Telescope git_files", "Find Git files" } lvim.builtin.which_key.mappings["o"] = { ":e#", "Go to last buffer" } lvim.builtin.which_key.mappings["bo"] = { "Telescope buffers previewer=false theme=dropdown initial_mode=normal", "Buffers" } --[[ BUILTIN PLUGINS After changing plugin config exit and reopen LunarVim, Run :PackerInstall :PackerCompile --]] -- Alpha lvim.builtin.alpha.active = true lvim.builtin.alpha.mode = "dashboard" -- Notify -- lvim.builtin.notify.active = true -- Terminal lvim.builtin.terminal.active = false -- Gitsigns lvim.builtin.gitsigns.active = false -- NvimTree lvim.builtin.nvimtree.setup.view.side = "left" lvim.builtin.nvimtree.setup.renderer.icons.show.git = true -- Bufferline lvim.builtin.bufferline.active = true lvim.builtin.bufferline.options.always_show_bufferline = true lvim.builtin.bufferline.options.mode = "buffers" -- Treesitter lvim.builtin.treesitter.ensure_installed = { "bash", "javascript", "json", "lua", "css", "rust", "yaml", "elm", "haskell" } lvim.builtin.treesitter.highlight.enabled = true lvim.builtin.treesitter.rainbow.enable = true lvim.builtin.treesitter.rainbow.extended_mode = true -- Telescope -- we use protected-mode (pcall) just in case the plugin wasn't loaded yet. local _, actions = pcall(require, "telescope.actions") lvim.builtin.telescope.defaults.mappings = { -- for input mode i = { [""] = actions.move_selection_next, [""] = actions.move_selection_previous, [""] = actions.cycle_history_next, [""] = actions.cycle_history_prev, }, -- for normal mode n = { [""] = actions.move_selection_next, [""] = actions.move_selection_previous, }, } lvim.builtin.telescope.pickers.find_files.theme = "dropdown" lvim.builtin.telescope.pickers.git_files = { theme = "dropdown" } -- Lualine local components = require("lvim.core.lualine.components") lvim.builtin.lualine.options = { theme = 'auto', component_separators = "|", section_separators = { left = "", right = "" }, } lvim.builtin.lualine.sections = { lualine_a = { { "mode", separator = { left = "" }, right_padding = 2 } }, lualine_b = { "filename", "branch", { "diff", colored = false } }, lualine_c = {}, lualine_x = { components.diagnostics, components.lsp }, lualine_y = { "filetype", "progress" }, lualine_z = { { "location", separator = { right = "" }, left_padding = 2 } }, } lvim.builtin.lualine.inactive_sections = { lualine_a = { "filename" }, lualine_b = {}, lualine_c = {}, lualine_x = {}, lualine_y = {}, lualine_z = {}, } -- LSP -- lvim.lsp.automatic_servers_installation = true -- -- make sure server will always be installed even if the server is in skipped_servers list -- lvim.lsp.installer.setup.ensure_installed = { -- "sumneko_lua", -- "jsonls", -- } --[[ ADDITIONAL PLUGINS ]] local numb = { "nacro90/numb.nvim", config = function() require("numb").setup() end } local colorschemes = { horizon = { "lunarvim/horizon.nvim" } } local rust_tools = { "simrat39/rust-tools.nvim", config = function() require("rust-tools").setup { tools = { autoSetHints = true, runnables = { use_telescope = true, }, }, server = { on_init = require("lvim.lsp").common_on_init, on_attach = function(client, bufnr) require("lvim.lsp").common_on_attach(client, bufnr) local rt = require "rust-tools" -- Hover actions vim.keymap.set("n", "ha", rt.hover_actions.hover_actions, { buffer = bufnr }) -- Code action groups vim.keymap.set("n", "lA", rt.code_action_group.code_action_group, { buffer = bufnr }) end, }, } end, ft = { "rust", "rs" }, } local git_fugitive = { "tpope/vim-fugitive", cmd = { "G", "Git", "Gdiffsplit", "Gread", "Gwrite", "Ggrep", "GMove", "GDelete", "GBrowse", "GRemove", "GRename", "Glgrep", "Gedit" }, ft = { "fugitive" } } local ts_rainbow = { "p00f/nvim-ts-rainbow", } lvim.plugins = { numb, rust_tools, git_fugitive, ts_rainbow } --[[ AUTOCOMMANDS ]] vim.api.nvim_create_autocmd("BufEnter", { pattern = { "*.json", "*.jsonc" }, -- enable wrap mode for json files only command = "setlocal wrap", }) vim.api.nvim_create_autocmd("FileType", { pattern = "zsh", callback = function() -- let treesitter use bash highlight for zsh files as well require("nvim-treesitter.highlight").attach(0, "bash") end, })