2023-02-22 00:02:06 +00:00
|
|
|
--[[
|
2023-04-24 00:01:47 +00:00
|
|
|
THESE ARE EXAMPLE CONFIGS FEEL FREE TO CHANGE TO WHATEVER YOU WANT
|
|
|
|
`lvim` is the global options object
|
2023-02-22 00:02:06 +00:00
|
|
|
]]
|
2023-04-24 00:01:47 +00:00
|
|
|
-- vim options
|
|
|
|
vim.opt.shiftwidth = 2
|
|
|
|
vim.opt.tabstop = 2
|
|
|
|
vim.opt.relativenumber = true
|
|
|
|
vim.cmd('autocmd FileType markdown setlocal nospell')
|
|
|
|
vim.g.vimtex_view_method = "zathura"
|
|
|
|
vim.maplocalleader = ","
|
|
|
|
vim.syntax = true
|
2023-02-22 00:02:06 +00:00
|
|
|
|
|
|
|
-- general
|
2023-04-02 01:26:43 +00:00
|
|
|
vim.opt.spell = false
|
|
|
|
vim.o.shell = '/usr/bin/fish'
|
2023-04-24 00:01:47 +00:00
|
|
|
lvim.log.level = "info"
|
|
|
|
lvim.format_on_save = {
|
|
|
|
enabled = true,
|
|
|
|
pattern = "*.lua",
|
|
|
|
timeout = 1000,
|
2023-03-31 13:34:13 +00:00
|
|
|
}
|
2023-02-22 00:02:06 +00:00
|
|
|
-- to disable icons and use a minimalist setup, uncomment the following
|
|
|
|
-- lvim.use_icons = false
|
|
|
|
|
2023-04-24 00:01:47 +00:00
|
|
|
-- keymappings <https://www.lunarvim.org/docs/configuration/keybindings>
|
2023-02-22 00:02:06 +00:00
|
|
|
lvim.leader = "space"
|
|
|
|
-- add your own keymapping
|
|
|
|
lvim.keys.normal_mode["<C-s>"] = ":w<cr>"
|
2023-04-24 00:01:47 +00:00
|
|
|
|
2023-02-22 00:02:06 +00:00
|
|
|
-- lvim.keys.normal_mode["<S-l>"] = ":BufferLineCycleNext<CR>"
|
|
|
|
-- lvim.keys.normal_mode["<S-h>"] = ":BufferLineCyclePrev<CR>"
|
|
|
|
|
2023-04-24 00:01:47 +00:00
|
|
|
-- -- 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" }
|
2023-02-22 00:02:06 +00:00
|
|
|
-- lvim.builtin.which_key.mappings["P"] = { "<cmd>Telescope projects<CR>", "Projects" }
|
|
|
|
|
2023-04-24 00:01:47 +00:00
|
|
|
-- -- Change theme settings
|
|
|
|
lvim.colorscheme = "tokyonight"
|
|
|
|
lvim.transparent_window = true
|
|
|
|
|
2023-02-22 00:02:06 +00:00
|
|
|
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
|
|
|
|
|
2023-04-24 00:01:47 +00:00
|
|
|
-- Automatically install missing parsers when entering buffer
|
|
|
|
lvim.builtin.treesitter.auto_install = true
|
|
|
|
|
2023-02-22 00:02:06 +00:00
|
|
|
-- if you don't want all the parsers change this to a table of the ones you want
|
|
|
|
lvim.builtin.treesitter.ensure_installed = {
|
|
|
|
"bash",
|
|
|
|
"c_sharp",
|
|
|
|
"lua",
|
|
|
|
"python",
|
|
|
|
"css",
|
2023-04-24 00:01:47 +00:00
|
|
|
"latex",
|
2023-02-22 00:02:06 +00:00
|
|
|
"yaml",
|
|
|
|
"toml",
|
|
|
|
}
|
|
|
|
|
2023-04-24 00:01:47 +00:00
|
|
|
-- lvim.builtin.treesitter.ignore_install = { "haskell" }
|
2023-02-22 00:02:06 +00:00
|
|
|
|
2023-04-24 00:01:47 +00:00
|
|
|
-- -- always installed on startup, useful for parsers without a strict filetype
|
|
|
|
-- lvim.builtin.treesitter.ensure_installed = { "comment", "markdown_inline", "regex" }
|
2023-02-22 00:02:06 +00:00
|
|
|
|
2023-04-24 00:01:47 +00:00
|
|
|
-- -- generic LSP settings <https://www.lunarvim.org/docs/languages#lsp-support>
|
2023-02-22 00:02:06 +00:00
|
|
|
|
2023-04-24 00:01:47 +00:00
|
|
|
-- --- disable automatic installation of servers
|
2023-02-22 00:02:06 +00:00
|
|
|
-- lvim.lsp.installer.setup.automatic_installation = false
|
|
|
|
|
2023-04-24 00:01:47 +00:00
|
|
|
-- ---configure a server manually. IMPORTANT: Requires `:LvimCacheReset` to take effect
|
|
|
|
-- ---see the full default list `:lua =lvim.lsp.automatic_configuration.skipped_servers`
|
2023-02-22 00:02:06 +00:00
|
|
|
-- 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)
|
|
|
|
|
2023-04-24 00:01:47 +00:00
|
|
|
-- ---remove a server from the skipped list, e.g. eslint, or emmet_ls. IMPORTANT: Requires `:LvimCacheReset` to take effect
|
2023-02-22 00:02:06 +00:00
|
|
|
-- ---`: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
|
|
|
|
|
2023-04-24 00:01:47 +00:00
|
|
|
-- -- linters and formatters <https://www.lunarvim.org/docs/languages#lintingformatting>
|
2023-02-22 00:02:06 +00:00
|
|
|
-- local formatters = require "lvim.lsp.null-ls.formatters"
|
|
|
|
-- formatters.setup {
|
2023-04-24 00:01:47 +00:00
|
|
|
-- { command = "stylua" },
|
2023-02-22 00:02:06 +00:00
|
|
|
-- {
|
|
|
|
-- command = "prettier",
|
2023-04-24 00:01:47 +00:00
|
|
|
-- extra_args = { "--print-width", "100" },
|
2023-02-22 00:02:06 +00:00
|
|
|
-- filetypes = { "typescript", "typescriptreact" },
|
|
|
|
-- },
|
|
|
|
-- }
|
|
|
|
-- local linters = require "lvim.lsp.null-ls.linters"
|
|
|
|
-- linters.setup {
|
|
|
|
-- { command = "flake8", filetypes = { "python" } },
|
|
|
|
-- {
|
|
|
|
-- command = "shellcheck",
|
2023-04-24 00:01:47 +00:00
|
|
|
-- args = { "--severity", "warning" },
|
2023-02-22 00:02:06 +00:00
|
|
|
-- },
|
|
|
|
-- }
|
|
|
|
|
2023-04-24 00:01:47 +00:00
|
|
|
-- Additional Plugins <https://www.lunarvim.org/docs/plugins#user-plugins>
|
2023-02-22 00:02:06 +00:00
|
|
|
lvim.plugins = {
|
2023-04-24 00:01:47 +00:00
|
|
|
{ "lunarvim/colorschemes" },
|
|
|
|
{ "folke/tokyonight.nvim" },
|
|
|
|
{ "puremourning/vimspector" },
|
|
|
|
{
|
|
|
|
"iamcco/markdown-preview.nvim",
|
|
|
|
build = "cd app && npm install",
|
|
|
|
ft = "markdown",
|
|
|
|
config = function()
|
|
|
|
vim.g.mkdp_auto_start = 1
|
|
|
|
end,
|
|
|
|
},
|
2023-02-22 00:02:06 +00:00
|
|
|
}
|
|
|
|
|
2023-04-24 00:01:47 +00:00
|
|
|
|
|
|
|
-- Plugin options
|
|
|
|
vim.g.vimspector_enable_mappings = 'HUMAN'
|
|
|
|
vim.g.vimspector_enable_mappings_for_mode = {
|
|
|
|
['<leader><leader>'] = { 'n', 'v' },
|
|
|
|
}
|
|
|
|
|
|
|
|
-- -- Autocommands (`:help autocmd`) <https://neovim.io/doc/user/autocmd.html>
|
2023-02-22 00:02:06 +00:00
|
|
|
-- 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,
|
|
|
|
-- })
|