Last active
August 6, 2023 02:43
-
-
Save gustavo-depaula/65cd647d8ff1984408c985f1fed2dcff to your computer and use it in GitHub Desktop.
Current lunar vim config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- | |
--[[ | |
THESE ARE EXAMPLE CONFIGS FEEL FREE TO CHANGE TO WHATEVER YOU WANT | |
`lvim` is the global options object | |
]] | |
-- vim options | |
vim.opt.shiftwidth = 2 | |
vim.opt.tabstop = 2 | |
vim.opt.relativenumber = true | |
-- general | |
lvim.log.level = "info" | |
lvim.format_on_save = { | |
enabled = true, | |
timeout = 1000, | |
} | |
-- to disable icons and use a minimalist setup, uncomment the following | |
-- lvim.use_icons = false | |
-- keymappings <https://www.lunarvim.org/docs/configuration/keybindings> | |
lvim.leader = "space" | |
-- add your own keymapping | |
lvim.keys.normal_mode["<C-s>"] = ":w<cr>" | |
-- lvim.keys.normal_mode["<Leader>gg"] = ":Git<cr>" | |
lvim.keys.normal_mode["<C-w>mm"] = ":only<cr>" | |
-- lvim.keys. | |
-- lvim.keys.normal_mode["<S-l>"] = ":BufferLineCycleNext<CR>" | |
-- lvim.keys.normal_mode["<S-h>"] = ":BufferLineCyclePrev<CR>" | |
-- -- Use which-key to add extra bindings with the leader-key prefix | |
-- lvim.builtin.which_key.mappings["W"] = { "<cmd>noautocmd w<cr>", "Save without formatting" } | |
-- lvim.builtin.which_key.mappings["P"] = { "<cmd>Telescope projects<CR>", "Projects" } | |
-- -- Change theme settings | |
-- vim.cmd [[ | |
-- if has('termguicolors') | |
-- set termguicolors | |
-- endif | |
-- ]] | |
vim.g.sonokai_diagnostic_text_highlight = true | |
vim.g.sonokai_enable_italic = true | |
vim.g.sonokai_colors_override = { | |
black = { "#181819", "232" }, | |
bg_dim = { "#222327", "232" }, | |
bg0 = { "#1c1e1f", "235" }, | |
bg1 = { "#33353f", "236" }, | |
bg2 = { "#363944", "236" }, | |
bg3 = { "#3b3e48", "237" }, | |
bg4 = { "#414550", "237" }, | |
bg_red = { "#ff6077", "203" }, | |
diff_red = { "#55393d", "52" }, | |
bg_green = { "#a7df78", "107" }, | |
diff_green = { "#394634", "22" }, | |
bg_blue = { "#85d3f2", "110" }, | |
diff_blue = { "#354157", "17" }, | |
diff_yellow = { "#4e432f", "54" }, | |
fg = { "#e2e2e3", "250" }, | |
red = { "#fb2874", "203" }, | |
orange = { "#fd971f", "215" }, | |
yellow = { "#e7c664", "179" }, | |
green = { "#b6e63e", "107" }, | |
blue = { "#66d9ef", "110" }, | |
purple = { "#b39df3", "176" }, | |
grey = { "#7f8490", "246" }, | |
grey_dim = { "#595f6f", "240" }, | |
none = { "NONE", "NONE" } | |
} | |
lvim.colorscheme = "sonokai" | |
-- After changing plugin config exit and reopen LunarVim, Run :PackerSync | |
lvim.builtin.alpha.active = true | |
lvim.builtin.alpha.mode = "dashboard" | |
lvim.builtin.terminal.active = true | |
lvim.builtin.nvimtree.setup.view.side = "left" | |
lvim.builtin.nvimtree.setup.renderer.icons.show.git = false | |
-- Automatically install missing parsers when entering buffer | |
lvim.builtin.treesitter.auto_install = true | |
-- lvim.builtin.treesitter.ignore_install = { "haskell" } | |
-- -- generic LSP settings <https://www.lunarvim.org/docs/languages#lsp-support> | |
-- --- disable automatic installation of servers | |
-- lvim.lsp.installer.setup.automatic_installation = false | |
-- ---configure a server manually. IMPORTANT: Requires `:LvimCacheReset` to take effect | |
-- ---see the full default list `:lua =lvim.lsp.automatic_configuration.skipped_servers` | |
-- vim.list_extend(lvim.lsp.automatic_configuration.skipped_servers, { "pyright" }) | |
-- local opts = {} -- check the lspconfig documentation for a list of all possible options | |
-- require("lvim.lsp.manager").setup("pyright", opts) | |
-- ---remove a server from the skipped list, e.g. eslint, or emmet_ls. IMPORTANT: Requires `:LvimCacheReset` to take effect | |
-- ---`:LvimInfo` lists which server(s) are skipped for the current filetype | |
-- lvim.lsp.automatic_configuration.skipped_servers = vim.tbl_filter(function(server) | |
-- return server ~= "emmet_ls" | |
-- end, lvim.lsp.automatic_configuration.skipped_servers) | |
-- -- you can set a custom on_attach function that will be used for all the language servers | |
-- -- See <https://github.com/neovim/nvim-lspconfig#keybindings-and-completion> | |
-- lvim.lsp.on_attach_callback = function(client, bufnr) | |
-- local function buf_set_option(...) | |
-- vim.api.nvim_buf_set_option(bufnr, ...) | |
-- end | |
-- --Enable completion triggered by <c-x><c-o> | |
-- buf_set_option("omnifunc", "v:lua.vim.lsp.omnifunc") | |
-- end | |
-- -- linters and formatters <https://www.lunarvim.org/docs/languages#lintingformatting> | |
local formatters = require "lvim.lsp.null-ls.formatters" | |
-- formatters.setup { | |
-- { command = "stylua" }, | |
-- { | |
-- command = "prettier", | |
-- extra_args = { "--print-width", "100" }, | |
-- filetypes = { "typescript", "typescriptreact" },star | |
-- }, | |
-- } | |
-- local linters = require "lvim.lsp.null-ls.linters" | |
-- linters.setup { | |
-- { command = "flake8", filetypes = { "python" } }, | |
-- { | |
-- command = "shellcheck, | |
-- args = { "--severity", "warning" }, | |
-- }, | |
-- } | |
vim.cmd [[ | |
let g:copilot_filetypes = { | |
\ 'yaml': v:true, | |
\ '*': v:true, | |
\ } | |
]] | |
formatters.setup { | |
{ | |
command = "prettier", | |
}, | |
} | |
-- -- Additional Plugins <https://www.lunarvim.org/docs/plugins#user-plugins> | |
lvim.plugins = { | |
-- { "ray-x/starry.nvim" }, | |
-- { 'crusoexia/vim-monokai' }, | |
-- { 'tomasr/molokai' }, | |
-- { 'fmoralesc/molokayo' }, | |
-- { 'sickill/vim-monokai' }, | |
{ 'sainnhe/sonokai', | |
config = function() | |
vim.g.sonokai_enable_italic = true | |
-- vim.g.sonokai_better_performance = true | |
-- | |
end, | |
}, | |
{ 'sakshamgupta05/vim-todo-highlight' }, | |
{ 'junegunn/fzf' }, | |
-- { "github/copilot.vim" }, | |
{ | |
"zbirenbaum/copilot.lua", | |
cmd = "Copilot", | |
event = "VimEnter", | |
config = function() | |
vim.defer_fn(function() | |
require('copilot').setup({ | |
panel = { | |
enabled = true, | |
auto_refresh = true, | |
keymap = { | |
jump_prev = "[[", | |
jump_next = "]]", | |
accept = "<CR>", | |
refresh = "gr", | |
open = "<M-CR>" | |
}, | |
}, | |
suggestion = { | |
enabled = true, | |
auto_trigger = true, | |
debounce = 75, | |
keymap = { | |
accept = "<C-i>", | |
accept_word = false, | |
accept_line = false, | |
next = "<M-]>", | |
prev = "<M-[>", | |
dismiss = "<C-]>", | |
}, | |
}, | |
filetypes = { | |
yaml = true, | |
markdown = false, | |
help = false, | |
gitcommit = true, | |
gitrebase = false, | |
hgcommit = false, | |
svn = false, | |
cvs = false, | |
["."] = false, | |
}, | |
copilot_node_command = 'node', -- Node.js version must be > 16.x | |
server_opts_overrides = {}, | |
}) | |
end, 100) | |
end, | |
}, | |
{ 'ap/vim-css-color' }, | |
{ 'junegunn/fzf.vim' }, | |
{ 'yuki-yano/fzf-preview.vim' }, | |
{ 'tpope/vim-fugitive' }, | |
{ 'folke/trouble.nvim' }, | |
{ 'adi/vim-indent-rainbow' }, | |
{ 'nvim-telescope/telescope-file-browser.nvim', | |
config = function() | |
require("telescope").load_extension "file_browser" | |
vim.api.nvim_set_keymap( | |
"n", | |
"<space>.", | |
":Telescope file_browser<cr>", | |
{ noremap = true } | |
) | |
end, | |
}, | |
} | |
-- Copilot, does it exists? | |
-- table.insert(lvim.plugins, { | |
-- "zbirenbaum/copilot-cmp", | |
-- event = "InsertEnter", | |
-- dependencies = { "zbirenbaum/copilot.lua" }, | |
-- config = function() | |
-- vim.defer_fn(function() | |
-- require("copilot").setup({ | |
-- suggestion = { enabled = false }, | |
-- panel = { enabled = false }, | |
-- }) | |
-- require("copilot_cmp").setup() -- https://github.com/zbirenbaum/copilot-cmp/blob/master/README.md#configuration | |
-- end, 100) | |
-- end, | |
-- }) | |
-- vim.g.sonokai_diagnostic_text_highlight = true | |
-- vim.g.sonokai_enable_italic = true | |
-- vim.api.nvim_set_keymap( | |
-- "n", | |
-- "<space>,", | |
-- ":Telescope file_browser<cr>", | |
-- { noremap = true } | |
-- ) | |
-- vim.g.copilot_no_tab_map = true | |
-- vim.g.copilot_assume_mapped = true | |
-- vim.g.copilot_tab_fallback = "" | |
-- local cmp = require "cmp" | |
-- lvim.builtin.cmp.mapping["<C-e>"] = function(fallback) | |
-- cmp.mapping.abort() | |
-- local copilot_keys = vim.fn["copilot#Accept"]() | |
-- if copilot_keys ~= "" then | |
-- vim.api.nvim_feedkeys(copilot_keys, "i", true) | |
-- else | |
-- fallback() | |
-- end | |
-- end | |
-- -- Autocommands (`:help autocmd`) <https://neovim.io/doc/user/autocmd.html> | |
-- vim.api.nvim_create_autocmd("FileType", {star | |
-- pattern = "zsh", | |
-- callback = function() | |
-- -- let treesitter use bash highlight for zsh files as well | |
-- require("nvim-treesitter.highlight").attach(0, "bash") | |
-- end, | |
-- }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment