aboutsummaryrefslogtreecommitdiff
path: root/nvim
diff options
context:
space:
mode:
authorschererleander <leander@leander-scherer.de>2024-08-09 12:17:21 +0200
committerschererleander <leander@leander-scherer.de>2024-08-09 12:17:21 +0200
commitf766e0f2e80689bc0cca8d7ace2e6371cc4292d6 (patch)
tree7c0ff679468b17a1f1c8c27dff21cdb84bfa094a /nvim
parent15e964fdfed0900f69bba52a1943f6143538046c (diff)
update
Diffstat (limited to 'nvim')
-rw-r--r--nvim/init.lua5
-rw-r--r--nvim/lazy-lock.json36
-rw-r--r--nvim/lua/autocmds.lua40
-rw-r--r--nvim/lua/options.lua68
-rw-r--r--nvim/lua/plugins.lua541
5 files changed, 351 insertions, 339 deletions
diff --git a/nvim/init.lua b/nvim/init.lua
index 716cc1c..607914b 100644
--- a/nvim/init.lua
+++ b/nvim/init.lua
@@ -11,7 +11,8 @@ if not vim.loop.fs_stat(lazypath) then
end
vim.opt.rtp:prepend(lazypath)
-require('autocmds')
-require('keymaps')
+
require('options')
+require('keymaps')
require('plugins')
+require('autocmds')
diff --git a/nvim/lazy-lock.json b/nvim/lazy-lock.json
index 088bc33..1fe1cf4 100644
--- a/nvim/lazy-lock.json
+++ b/nvim/lazy-lock.json
@@ -1,23 +1,23 @@
{
- "Comment.nvim": { "branch": "master", "commit": "0236521ea582747b58869cb72f70ccfa967d2e89" },
- "LuaSnip": { "branch": "master", "commit": "0df29db3543837f8b41597f2640397c5ec792b7b" },
- "alpha-nvim": { "branch": "main", "commit": "234822140b265ec4ba3203e3e0be0e0bb826dff5" },
+ "LuaSnip": { "branch": "master", "commit": "a7a4b4682c4b3e2ba82b82a4e6e5f5a0e79dec32" },
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
"cmp-cmdline": { "branch": "main", "commit": "8ee981b4a91f536f52add291594e89fb6645e451" },
- "cmp-nvim-lsp": { "branch": "main", "commit": "44b16d11215dce86f253ce0c30949813c0a90765" },
+ "cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" },
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
- "coal.nvim": { "branch": "main", "commit": "2a1aaad91fbe795a913fc4b402c82b961cf5aa31" },
- "indent-blankline.nvim": { "branch": "master", "commit": "9301e434dd41154ffe5c3d5b8a5c9acd075ebeff" },
- "lazy.nvim": { "branch": "main", "commit": "96584866b9c5e998cbae300594d0ccfd0c464627" },
- "mason-lspconfig.nvim": { "branch": "main", "commit": "e7b64c11035aa924f87385b72145e0ccf68a7e0a" },
- "mason.nvim": { "branch": "main", "commit": "cd7835b15f5a4204fc37e0aa739347472121a54c" },
- "nvim-autopairs": { "branch": "master", "commit": "f6c71641f6f183427a651c0ce4ba3fb89404fa9e" },
- "nvim-cmp": { "branch": "main", "commit": "5dce1b778b85c717f6614e3f4da45e9f19f54435" },
- "nvim-lspconfig": { "branch": "master", "commit": "e49b1e90c1781ce372013de3fa93a91ea29fc34a" },
- "nvim-tree.lua": { "branch": "master", "commit": "40b9b887d090d5da89a84689b4ca0304a9649f62" },
- "nvim-treesitter": { "branch": "master", "commit": "9c4fc86b67c1d68141cef57846d24cbee9b74fb0" },
- "nvim-web-devicons": { "branch": "master", "commit": "3af745113ea537f58c4b1573b64a429fefad9e07" },
- "plenary.nvim": { "branch": "master", "commit": "50012918b2fc8357b87cff2a7f7f0446e47da174" },
- "staline.nvim": { "branch": "main", "commit": "280c966df73a840d79d5fa0bda08fab50aba05c6" },
- "telescope.nvim": { "branch": "master", "commit": "74ce793a60759e3db0d265174f137fb627430355" }
+ "gitsigns.nvim": { "branch": "main", "commit": "4e348641b8206c3b8d23080999e3ddbe4ca90efc" },
+ "lazy.nvim": { "branch": "main", "commit": "83493db50a434a4c5c648faf41e2ead80f96e478" },
+ "mason-lspconfig.nvim": { "branch": "main", "commit": "55716a879568a498fa236593c8119789054a3b8e" },
+ "mason.nvim": { "branch": "main", "commit": "3b5068f0fc565f337d67a2d315d935f574848ee7" },
+ "mini.nvim": { "branch": "main", "commit": "e025ee74705b04dd25a132a521c9c535dc78a8d8" },
+ "nightfox.nvim": { "branch": "main", "commit": "a4eb88b2dad3fba5c2d87f82cd15dfb9de73913d" },
+ "nvim-autopairs": { "branch": "master", "commit": "4a39f2dcbe1967ddc3a0f76f863540dd3aa7871a" },
+ "nvim-cmp": { "branch": "main", "commit": "04e0ca376d6abdbfc8b52180f8ea236cbfddf782" },
+ "nvim-lint": { "branch": "master", "commit": "941fa1220a61797a51f3af9ec6b7d74c8c7367ce" },
+ "nvim-lspconfig": { "branch": "master", "commit": "4bdd3800b4148f670c6cf55ef65f490148eeb550" },
+ "nvim-treesitter": { "branch": "master", "commit": "35c1a32b267c969a024ef651c8a25d7ff9018d22" },
+ "nvim-web-devicons": { "branch": "master", "commit": "75df79feb02d5e0ec114e447453775d4d291ea03" },
+ "plenary.nvim": { "branch": "master", "commit": "f7adfc4b3f4f91aab6caebf42b3682945fbc35be" },
+ "staline.nvim": { "branch": "main", "commit": "c49f2deaba3d3c669e7243b57619e0078e7a351b" },
+ "telescope.nvim": { "branch": "master", "commit": "b323abeb4baf9e4851c3af1961e770ce76c657c7" },
+ "toggleterm.nvim": { "branch": "main", "commit": "193786e0371e3286d3bc9aa0079da1cd41beaa62" }
} \ No newline at end of file
diff --git a/nvim/lua/autocmds.lua b/nvim/lua/autocmds.lua
index 1a13cf4..e8dd426 100644
--- a/nvim/lua/autocmds.lua
+++ b/nvim/lua/autocmds.lua
@@ -1,24 +1,32 @@
-vim.cmd([[
-augroup TexToPDF
- autocmd!
- autocmd BufWritePost *.tex silent !pdflatex "%"
-augroup END
-]])
+-- transparent background
+--vim.cmd('highlight Normal guibg=NONE ctermbg=NONE')
+--vim.cmd('highlight LineNr guifg=NONE guibg=NONE ctermfg=NONE ctermbg=NONE')
+--vim.cmd('highlight NormalNC guibg=NONE ctermbg=NONE')
+--vim.cmd('highlight CursorLine guibg=NONE ctermbg=NONE')
+-- completion menu transparent
+--vim.cmd('highlight Pmenu guibg=NONE ctermbg=NONE')
+--vim.cmd('highlight PmenuSel guibg=NONE ctermbg=NONE')
+-- vertical lines transparent
+vim.cmd('highlight WinSeparator guibg=None ctermbg=None')
+vim.cmd('highlight VertSplit guibg=NONE ctermbg=NONE')
+-- hide background lsp coloum
+vim.cmd('highlight SignColumn guibg=NONE ctermbg=None')
-vim.cmd([[
-augroup MarkdownToPDF
- autocmd!
- autocmd BufWritePost *.md silent !pandoc "%:p" -o "%:p:r.pdf"
-augroup END
-]])
+vim.cmd('autocmd FileType tex setlocal wrap linebreak')
--- Set Up Spellchecking for German
+vim.cmd('autocmd BufWritePost *.tex silent !pdflatex %<CR>')
+
+vim.api.nvim_create_autocmd({ "BufWritePre" }, {
+ pattern = { "*" },
+ command = [[%s/\s\+$//e]],
+})
+
+-- enable spellchecking
vim.opt.spelllang = 'de'
vim.opt.spell = true
--- Enable Spellchecking and Highlighting
-vim.opt.spell = true
+-- set up spellchecking highlighting
vim.cmd('highlight SpellBad cterm=underline gui=underline')
vim.cmd('highlight SpellCap cterm=underline gui=underline')
vim.cmd('highlight SpellRare cterm=underline gui=underline')
-vim.cmd('highlight SpellLocal cterm=underline gui=underline') \ No newline at end of file
+vim.cmd('highlight SpellLocal cterm=underline gui=underline')
diff --git a/nvim/lua/options.lua b/nvim/lua/options.lua
index 5b431d9..0530063 100644
--- a/nvim/lua/options.lua
+++ b/nvim/lua/options.lua
@@ -1,43 +1,45 @@
local options = {
- list = false,
- backup = false, -- creates a backup file
- clipboard = "unnamedplus", -- allows neovim to access the system clipboard
- conceallevel = 0, -- so that `` is visible in markdown files
- fileencoding = "utf-8", -- the encoding written to a file
- hidden = true, -- required to keep multiple buffers and open multiple buffers
- hlsearch = true, -- highlight all matches on previous search pattern
- ignorecase = true, -- ignore case in search patterns
- mouse = "a", -- allow the mouse to be used in neovim
- laststatus = 3,
- showmode = false, -- we don't need to see things like -- INSERT -- anymore
- smartcase = true, -- smart case
- smartindent = true, -- make indenting smarter again
- splitbelow = true, -- force all horizontal splits to go below current window ↕️
- splitright = true, -- force all vertical splits to go to the right of current window ↔️
- swapfile = false, -- creates a swapfile
- termguicolors = true, -- set term gui colors (most terminals support this)
- timeoutlen = 100, -- time to wait for a mapped sequence to complete (in milliseconds)
- undofile = true, -- enable persistent undo
- updatetime = 300, -- faster completion (4000ms default) ⚡
- writebackup = false, -- if a file is being edited by another program, it is not allowed to be edited
- expandtab = false, -- use tabs instead of spaces ␣
- pumheight = 10,
- cmdheight = 2,
- shiftwidth = 2, -- the number of spaces inserted for each indentation
- tabstop = 2, -- insert 2 spaces for a tab ⇥
- cursorline = false, -- highlight the current line (disabled for now)
- number = false, -- set numbered lines
- relativenumber = false, -- set relative numbered lines
- numberwidth = 4, -- set number column width to 2 (default 4)
- wrap = false, -- display lines as one long lines
+ list = false,
+ backup = false, -- creates a backup file
+ clipboard = "unnamedplus", -- allows neovim to access the system clipboard
+ conceallevel = 0, -- so that `` is visible in markdown files
+ fileencoding = "utf-8", -- the encoding written to a file
+ hidden = true, -- required to keep multiple buffers and open multiple buffers
+ hlsearch = true, -- highlight all matches on previous search pattern
+ ignorecase = true, -- ignore case in search patterns
+ mouse = "a", -- allow the mouse to be used in neovim
+ laststatus = 3,
+ showmode = false, -- we don't need to see things like -- INSERT -- anymore
+ smartcase = true, -- smart case
+ smartindent = true, -- make indenting smarter again
+ splitbelow = true, -- force all horizontal splits to go below current window ↕️
+ splitright = true, -- force all vertical splits to go to the right of current window ↔️
+ swapfile = false, -- creates a swapfile
+ termguicolors = true, -- set term gui colors (most terminals support this)
+ timeoutlen = 100, -- time to wait for a mapped sequence to complete (in milliseconds)
+ undofile = true, -- enable persistent undo
+ updatetime = 300, -- faster completion (4000ms default) ⚡
+ writebackup = false, -- if a file is being edited by another program, it is not allowed to be edited
+ expandtab = true, -- use tabs instead of spaces ␣
+ pumheight = 10,
+ cmdheight = 2,
+ shiftwidth = 2, -- the number of spaces inserted for each indentation
+ tabstop = 2, -- insert 2 spaces for a tab ⇥
+ cursorline = false, -- highlight the current line (disabled for now)
+ number = false, -- set numbered lines
+ relativenumber = false, -- set relative numbered lines
+ numberwidth = 4, -- set number column width to 2 (default 4)
+ wrap = false, -- display lines as one long lines
}
vim.opt.shortmess:append 'c'
for k, v in pairs(options) do
- vim.opt[k] = v
+ vim.opt[k] = v
end
vim.wo.list = false
-
vim.cmd 'set whichwrap+=<,>,[,],h,l'
+
+-- lazy load
+vim.loader.enable()
diff --git a/nvim/lua/plugins.lua b/nvim/lua/plugins.lua
index 8216718..d8d2a73 100644
--- a/nvim/lua/plugins.lua
+++ b/nvim/lua/plugins.lua
@@ -1,275 +1,276 @@
-require('lazy').setup({
- -- Portable package manager to install and manage LSP servers, DAP servers, linters, and formatters.
+require("lazy").setup({
{
- 'williamboman/mason.nvim',
- dependencies = { 'williamboman/mason-lspconfig.nvim' },
- config = function()
- require('mason').setup()
- require('mason-lspconfig').setup({ automatic_installation = true })
+ "EdenEast/nightfox.nvim",
+ priority = 1000,
+ options = {
+ transparent = true,
+ terminal_colors = true,
+ dim_inactive = false,
+ module_default = true,
+ styles = {
+ comments = "italic",
+ keywords = "italic",
+ },
+ inverse = {
+ match_paren = false,
+ visual = false,
+ search = false,
+ },
+ },
+ config = function ()
+ vim.cmd("colorscheme terafox")
end
- }, -- A completion engine plugin for neovim written in Lua.
- {
- 'hrsh7th/nvim-cmp',
- lazy = false,
- dependencies = {
- {
- 'neovim/nvim-lspconfig',
- config = function()
- local signs = {
- Error = " ",
- Warn = " ",
- Hint = " ",
- Info = " "
- }
- for type, icon in pairs(signs) do
- local hl = "DiagnosticSign" .. type
- vim.fn.sign_define(hl, {
- text = icon,
- texthl = hl,
- numhl = hl
- })
- end
+ },
+ {
+ "hrsh7th/nvim-cmp",
+ dependencies = {
+ "williamboman/mason.nvim",
+ "williamboman/mason-lspconfig.nvim",
+ "neovim/nvim-lspconfig",
+ "hrsh7th/cmp-nvim-lsp",
+ "hrsh7th/cmp-buffer",
+ "hrsh7th/cmp-path",
+ "hrsh7th/cmp-cmdline",
+ "L3MON4D3/LuaSnip",
+ },
+ event = "InsertEnter",
+ config = function()
+ require("mason").setup()
+ require("mason-lspconfig").setup({ automatic_installation = true })
- local lsp = require('lspconfig')
- local capabilities =
- require('cmp_nvim_lsp').default_capabilities()
- lsp.pyright.setup {
- capabilities = capabilities,
- settings = { update_in_insert = true }
- }
- lsp.ltex.setup({
- settings = {
- ltex = {
- language = "de-DE"
- }
- }
- })
- lsp.texlab.setup {
- capabilities = capabilities
- }
- lsp.lua_ls.setup {
- capabilities = capabilities,
- settings = {
- Lua = {
- diagnostics = {
- -- Get the language server to recognize the 'vim' global
- globals = { 'vim' }
- },
- workspace = {
- -- make the server aware of the neovim runtime files
- libary = vim.api.nvim_get_runtime_file('',
- true)
- },
- telemetry = {
- -- do not send telemetry data containing a randomized but unique identifier
- enable = false
- }
- }
- }
- }
- end
- }, 'hrsh7th/cmp-nvim-lsp', 'hrsh7th/cmp-buffer', 'hrsh7th/cmp-path',
- 'hrsh7th/cmp-cmdline', 'L3MON4D3/LuaSnip'
- },
- config = function()
- local cmp = require('cmp')
- local luasnip = require("luasnip")
- cmp.setup({
- snippet = {
- expand = function(args)
- luasnip.lsp_expand(args.body)
- end
- },
- mapping = cmp.mapping.preset.insert {
- ['<C-d>'] = cmp.mapping.scroll_docs(-4),
- ['<C-f>'] = cmp.mapping.scroll_docs(4),
- ['<C-Space>'] = cmp.mapping.complete(),
- ['<C-e>'] = cmp.mapping.close(),
- ['<CR>'] = cmp.mapping.confirm {
- behavior = cmp.ConfirmBehavior.Replace,
- select = true
- },
- ["<Tab>"] = cmp.mapping(function(fallback)
- if cmp.visible() then
- cmp.select_next_item()
- elseif luasnip.expand_or_jumpable() then
- luasnip.expand_or_jump()
- else
- fallback()
- end
- end, { "i", "s" }),
- ["<S-Tab>"] = cmp.mapping(function(fallback)
- if cmp.visible() then
- cmp.select_prev_item()
- elseif luasnip.jumpable(-1) then
- luasnip.jump(-1)
- else
- fallback()
- end
- end, { "i", "s" })
- },
- sources = {
- { name = 'nvim_lsp' },
- { name = 'luasnip' },
- { name = 'buffer' },
- { name = 'path' }
- }
- })
- end
- }, -- A super powerful autopair plugin for Neovim that supports multiple characters.
- {
- 'windwp/nvim-autopairs',
- config = function()
- require("nvim-autopairs").setup()
- -- inserts `(` after selecting a function or method item
- require('cmp').event:on('confirm_done', require(
- 'nvim-autopairs.completion.cmp').on_confirm_done())
- end
- }, -- Adds indentation guides to all lines.
- {
- 'lukas-reineke/indent-blankline.nvim',
- main = "ibl",
- opt = { filetypes = { "help", "terminal", "alpha", "lazy", "NvimTree" } }
- }, --
- {
- 'nvim-treesitter/nvim-treesitter',
- build = ':TSUpdate',
- config = function()
- require('nvim-treesitter.configs').setup({
- auto_install = true,
- ensure_installed = { 'c', 'lua', 'vim' },
- highlight = { enable = true, use_languagetree = true },
- indent = { enable = true }
- })
- end
- }, -- A File Explorer for Neovim written in Lua
- {
- 'nvim-tree/nvim-tree.lua',
- config = function()
- -- disable netrw (inbuild file explorer)
- require('nvim-tree').setup({
- view = { width = 20, side = 'left' },
- --disable_netrw = true,
- hijack_cursor = true,
- update_cwd = true,
- hijack_directories = { auto_open = true },
- renderer = {
- root_folder_label = false,
- indent_markers = {
- enable = true,
- icons = { corner = "└ ", edge = "│ ", none = " " }
- }
- }
- })
- end
- }, --
- {
- 'nvim-telescope/telescope.nvim',
- dependencies = { 'nvim-lua/plenary.nvim' },
- config = function()
- require('telescope').setup({
- defaults = { mapping = {} },
- pickers = {},
- extensions = {}
- })
- vim.api.nvim_set_keymap('n', '<C-s>',
- ':Telescope current_buffer_fuzzy_find<CR>',
- { noremap = true, silent = true })
- end
- }, -- formatting
- {
- 'stevearc/conform.nvim',
- event = { "BufReadPre", "BufNewFile" },
- config = function()
- require('conform').setup({
- format_on_save = {
- timeout_ms = 500,
- lsp_fallback = true
- },
- lua = { "stylua" },
- })
- end
- }, --
- {
- 'mfussenegger/nvim-lint',
- event = { "BufReadPre", "BufNewFile" },
- config = function()
- local lint = require('lint')
- lint.linters_by_ft = {
+ local lspconfig = require("lspconfig")
+ local signs = {
+ Error = " ",
+ Warn = " ",
+ Hint = " ",
+ Info = " ",
+ }
+ for type, icon in pairs(signs) do
+ local hl = "DiagnosticSign" .. type
+ vim.fn.sign_define(hl, {
+ text = icon,
+ texthl = hl,
+ numhl = hl,
+ })
+ end
- }
- vim.api.nvim_create_autocmd({ "BufWritePost" }, {
- callback = function()
- require("lint").try_lint()
- end,
- })
- end
- }, -- Customize start up screen
- {
- 'goolord/alpha-nvim',
- event = 'VimEnter',
- dependencies = { 'nvim-tree/nvim-web-devicons' },
- config = function()
- local mew = {
- '⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⡴⠞⢳⠀⠀⠀⠀⠀',
- '⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡔⠋⠀⢰⠎⠀⠀⠀⠀⠀',
- '⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣼⢆⣤⡞⠃⠀⠀⠀⠀⠀⠀',
- '⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣼⢠⠋⠁⠀⠀⠀⠀⠀⠀⠀⠀',
- '⠀⠀⠀⠀⢀⣀⣾⢳⠀⠀⠀⠀⢸⢠⠃⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀',
- '⣀⡤⠴⠊⠉⠀⠀⠈⠳⡀⠀⠀⠘⢎⠢⣀⣀⣀⠀⠀⠀⠀⠀⠀⠀',
- '⠳⣄⠀⠀⡠⡤⡀⠀⠘⣇⡀⠀⠀⠀⠉⠓⠒⠺⠭⢵⣦⡀⠀⠀⠀',
- '⠀⢹⡆⠀⢷⡇⠁⠀⠀⣸⠇⠀⠀⠀⠀⠀⢠⢤⠀⠀⠘⢷⣆⡀⠀',
- '⠀⠀⠘⠒⢤⡄⠖⢾⣭⣤⣄⠀⡔⢢⠀⡀⠎⣸⠀⠀⠀⠀⠹⣿⡀',
- '⠀⠀⢀⡤⠜⠃⠀⠀⠘⠛⣿⢸⠀⡼⢠⠃⣤⡟⠀⠀⠀⠀⠀⣿⡇',
- '⠀⠀⠸⠶⠖⢏⠀⠀⢀⡤⠤⠇⣴⠏⡾⢱⡏⠁⠀⠀⠀⠀⢠⣿⠃',
- '⠀⠀⠀⠀⠀⠈⣇⡀⠿⠀⠀⠀⡽⣰⢶⡼⠇⠀⠀⠀⠀⣠⣿⠟⠀',
- '⠀⠀⠀⠀⠀⠀⠈⠳⢤⣀⡶⠤⣷⣅⡀⠀⠀⠀⣀⡠⢔⠕⠁⠀⠀',
- '⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠙⠫⠿⠿⠿⠛⠋⠁⠀⠀⠀⠀',
- ''
- }
- local alpha = require('alpha')
- local dashboard = require('alpha.themes.dashboard')
- dashboard.section.header.val = mew
- dashboard.section.buttons.val = {
- dashboard.button('f', ' Find Files',
- ':Telescope find_files <CR>'),
- dashboard.button('r', '󱔗 Recent Files',
- ':Telescope oldfiles <CR>'),
- dashboard.button('u', ' Update Plugins', ':Lazy update <CR>'),
- dashboard.button('q', ' Quit Neovim', ':q! <CR>')
- }
- dashboard.section.buttons.opts.spacing = 1
- dashboard.section.footer.val = 'Never knows best'
- dashboard.opts.opts.noautocmd = true
- alpha.setup(dashboard.opts)
- end
- }, --
- {
- 'tamton-aquib/staline.nvim',
- dependencies = { 'nvim-tree/nvim-web-devicons' },
- config = function()
- require "staline".setup {
- sections = {
- left = { ' ' },
- mid = { 'lsp' },
- right = { 'line_column' }
- },
- lsp_symbols = {
- Error = " ",
- Info = " ",
- Warn = " ",
- Hint = ""
- },
- defaults = {
- true_colors = true,
- line_column = ' ☰ %l/%L %c',
- branch_symbol = " ",
- exclude_fts = { 'NvimTree', 'Alpha' }
- }
- }
- -- remove background color
- vim.cmd('highlight Statusline guibg=none')
- vim.cmd('highlight StatuslineNC guibg=none')
- end
- }
+ local servers = require('mason-lspconfig').get_installed_servers()
+ for _, server in pairs(servers) do
+ lspconfig[server].setup{}
+ end
+
+ local capabilities = require("cmp_nvim_lsp").default_capabilities()
+ lspconfig.lua_ls.setup({
+ capabilities = capabilities,
+ settings = {
+ Lua = {
+ diagnostics = {
+ globals = { "vim" },
+ },
+ workspace = {
+ library = vim.api.nvim_get_runtime_file("", true),
+ },
+ telemetry = {
+ enable = false,
+ },
+ },
+ },
+ })
+
+ local cmp = require("cmp")
+ local luasnip = require("luasnip")
+ require("luasnip.loaders.from_vscode").lazy_load()
+ cmp.setup({
+ snippet = {
+ expand = function(args)
+ luasnip.lsp_expand(args.body)
+ end,
+ },
+ mapping = cmp.mapping.preset.insert({
+ ["<C-d>"] = cmp.mapping.scroll_docs(-4),
+ ["<C-f>"] = cmp.mapping.scroll_docs(4),
+ ["<C-Space>"] = cmp.mapping.complete(),
+ ["<C-e>"] = cmp.mapping.close(),
+ ["<CR>"] = cmp.mapping.confirm({
+ behavior = cmp.ConfirmBehavior.Replace,
+ select = true,
+ }),
+ ["<Tab>"] = cmp.mapping(function(fallback)
+ if cmp.visible() then
+ cmp.select_next_item()
+ elseif luasnip.expand_or_jumpable() then
+ luasnip.expand_or_jump()
+ else
+ fallback()
+ end
+ end, { "i", "s" }),
+ ["<S-Tab>"] = cmp.mapping(function(fallback)
+ if cmp.visible() then
+ cmp.select_prev_item()
+ elseif luasnip.jumpable(-1) then
+ luasnip.jump(-1)
+ else
+ fallback()
+ end
+ end, { "i", "s" }),
+ }),
+ sources = {
+ { name = "nvim_lsp" },
+ { name = "luasnip" },
+ { name = "buffer" },
+ { name = "path" },
+ },
+ })
+ end,
+ },
+
+ {
+ "nvim-treesitter/nvim-treesitter",
+ build = ":TSUpdate",
+ event = "BufRead",
+ config = function()
+ require("nvim-treesitter.configs").setup({
+ auto_install = true,
+ ensure_installed = { "c", "lua", "vim" },
+ highlight = { enable = true, use_languagetree = true },
+ indent = { enable = true },
+ })
+ end,
+ },
+
+ {
+ "nvim-tree/nvim-tree.lua",
+ enabled = false,
+ config = function()
+ require("nvim-tree").setup({
+ view = { width = 20, side = "left" },
+ disable_netrw = true,
+ hijack_cursor = true,
+ update_cwd = true,
+ hijack_directories = { auto_open = true },
+ renderer = {
+ root_folder_label = false,
+ indent_markers = {
+ enable = true,
+ icons = { corner = "└ ", edge = "│ ", none = " " },
+ },
+ },
+ })
+ end,
+ },
+
+ {
+ "nvim-telescope/telescope.nvim",
+ dependencies = { "nvim-lua/plenary.nvim" },
+ keys = {
+ {"<C-s>", ":silent Telescope current_buffer_fuzzy_find<CR>", desc = "Open Telescope"}
+ },
+ config = function()
+ require("telescope").setup({
+ defaults = { mapping = {} },
+ pickers = {},
+ extensions = {},
+ })
+ end,
+ },
+
+ {
+ "akinsho/toggleterm.nvim",
+ version = "*",
+ config = true,
+ },
+
+ {
+ "lewis6991/gitsigns.nvim",
+ config = function()
+ require("gitsigns").setup()
+ end,
+ },
+
+ {
+ "mfussenegger/nvim-lint",
+ event = { "BufReadPre", "BufNewFile" },
+ config = function()
+ local lint = require("lint")
+
+ lint.linter_by_ft = {
+ lua = { "luachecker" },
+ python = { "pylint" },
+ }
+
+ local lint_augroup = vim.api.nvim_create_augroup("lint", { clear = true })
+
+ vim.api.nvim_create_autocmd({ "BufEnter", "BufWritePost", "InsertLeave" }, {
+ group = lint_augroup,
+ callback = function()
+ lint.try_lint()
+ end,
+ })
+ end,
+ },
+
+ {
+ "echasnovski/mini.nvim",
+ version = false,
+ dependencies = { "nvim-tree/nvim-web-devicons" },
+ config = function()
+ require("mini.starter").setup({
+ header = table.concat({
+ " /l、 ",
+ "(゚、 。 7 ",
+ " l ~ ヽ ",
+ " じしf_,)ノ ",
+ }, "\n"),
+ footer = "",
+ content_hooks = {
+ require("mini.starter").gen_hook.adding_bullet("» "),
+ require("mini.starter").gen_hook.aligning("center", "center"),
+ },
+ })
+ end,
+ },
+
+ {
+ 'windwp/nvim-autopairs',
+ event = "InsertEnter",
+ config = function ()
+ require("nvim-autopairs").setup{}
+ end
+ },
+
+ {
+ 'tamton-aquib/staline.nvim',
+ dependencies = { 'nvim-tree/nvim-web-devicons' },
+ config = function()
+ require "staline".setup {
+ sections = {
+ left = { 'file_name', 'branch' },
+ mid = { 'lsp' },
+ right = { 'line_column' }
+ },
+ special_table = {
+ NvimTree = { 'NvimTree', ' ' },
+ packer = { 'Packer', ' ' },
+ starter = { '', '' },
+ lazy = { '', '' },
+ mason = { '', '' }
+ },
+ lsp_symbols = {
+ Error = " ",
+ Info = " ",
+ Warn = " ",
+ Hint = ""
+ },
+ defaults = {
+ true_colors = true,
+ line_column = ' ☰ %l/%L %c',
+ branch_symbol = " ",
+ exclude_fts = { 'NvimTree' }
+ }
+ }
+ vim.cmd('highlight Statusline guibg=none')
+ vim.cmd('highlight StatuslineNC guibg=none')
+ end,
+ }
})
+