From 0561e714bb476d936e51f6e49292542712255dec Mon Sep 17 00:00:00 2001 From: Leander <80996591+m0ntagur@users.noreply.github.com> Date: Sat, 13 Aug 2022 00:31:07 +0200 Subject: Add files via upload --- nvim/plugin/autopairs.lua | 6 ++++ nvim/plugin/autotag.lua | 4 +++ nvim/plugin/cmp.lua | 34 +++++++++++++++++++ nvim/plugin/colorizer.lua | 6 ++++ nvim/plugin/dashboard.lua | 27 +++++++++++++++ nvim/plugin/lspconfig.lua | 38 +++++++++++++++++++++ nvim/plugin/lspkind.lua | 49 ++++++++++++++++++++++++++++ nvim/plugin/lspsaga.lua | 16 +++++++++ nvim/plugin/lualine.lua | 43 ++++++++++++++++++++++++ nvim/plugin/mason.lua | 24 ++++++++++++++ nvim/plugin/telescope.lua | 78 ++++++++++++++++++++++++++++++++++++++++++++ nvim/plugin/treesitter.lua | 23 +++++++++++++ nvim/plugin/web-devicons.lua | 12 +++++++ nvim/plugin/zen-mode.lua | 7 ++++ 14 files changed, 367 insertions(+) create mode 100644 nvim/plugin/autopairs.lua create mode 100644 nvim/plugin/autotag.lua create mode 100644 nvim/plugin/cmp.lua create mode 100644 nvim/plugin/colorizer.lua create mode 100644 nvim/plugin/dashboard.lua create mode 100644 nvim/plugin/lspconfig.lua create mode 100644 nvim/plugin/lspkind.lua create mode 100644 nvim/plugin/lspsaga.lua create mode 100644 nvim/plugin/lualine.lua create mode 100644 nvim/plugin/mason.lua create mode 100644 nvim/plugin/telescope.lua create mode 100644 nvim/plugin/treesitter.lua create mode 100644 nvim/plugin/web-devicons.lua create mode 100644 nvim/plugin/zen-mode.lua (limited to 'nvim/plugin') diff --git a/nvim/plugin/autopairs.lua b/nvim/plugin/autopairs.lua new file mode 100644 index 0000000..f04342b --- /dev/null +++ b/nvim/plugin/autopairs.lua @@ -0,0 +1,6 @@ +local status, autopairs = pcall(require, "nvim-autopairs") +if (not status) then return end + +autopairs.setup({ + disable_filetype = { "TelescopePrompt" }, +}) \ No newline at end of file diff --git a/nvim/plugin/autotag.lua b/nvim/plugin/autotag.lua new file mode 100644 index 0000000..ac6fb8f --- /dev/null +++ b/nvim/plugin/autotag.lua @@ -0,0 +1,4 @@ +local status, autotag = pcall(require, 'nvim-ts-autotag') +if (not status) then return end + +autotag.setup() diff --git a/nvim/plugin/cmp.lua b/nvim/plugin/cmp.lua new file mode 100644 index 0000000..09a2772 --- /dev/null +++ b/nvim/plugin/cmp.lua @@ -0,0 +1,34 @@ +local status, cmp = pcall(require, "cmp") +if (not status) then return end + +local lspkind = require 'lspkind' + +cmp.setup({ + snippet = { + expand = function(args) + require('luasnip').lsp_expand(args.body) + end, + }, + mapping = cmp.mapping.preset.insert({ + [''] = cmp.mapping.scroll_docs(-4), + [''] = cmp.mapping.scroll_docs(4), + [''] = cmp.mapping.complete(), + [''] = cmp.mapping.close(), + [''] = cmp.mapping.confirm({ + behavior = cmp.ConfirmBehavior.Replace, + select = true + }), + }), + sources = cmp.config.sources({ + { name = 'nvim_lsp' }, + { name = 'buffer' }, + }), + formatting = { + format = lspkind.cmp_format({ with_text = false, maxwidth = 50 }) + } +}) + +vim.cmd [[ + set completeopt=menuone,noinsert,noselect + highlight! default link CmpItemKind CmpItemMenuDefault +]] \ No newline at end of file diff --git a/nvim/plugin/colorizer.lua b/nvim/plugin/colorizer.lua new file mode 100644 index 0000000..62a654c --- /dev/null +++ b/nvim/plugin/colorizer.lua @@ -0,0 +1,6 @@ +local status, colorizer = pcall(require, "colorizer") +if (not status) then return end + +colorizer.setup({ + '*'; +}) diff --git a/nvim/plugin/dashboard.lua b/nvim/plugin/dashboard.lua new file mode 100644 index 0000000..fb72238 --- /dev/null +++ b/nvim/plugin/dashboard.lua @@ -0,0 +1,27 @@ +local status, dashboard = pcall(require, 'dashboard') +if not status then return end + +dashboard.custom_header= { +'', +'⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⡴⠞⢳⠀⠀⠀⠀⠀', +'⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡔⠋⠀⢰⠎⠀⠀⠀⠀⠀', +'⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣼⢆⣤⡞⠃⠀⠀⠀⠀⠀⠀', +'⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣼⢠⠋⠁⠀⠀⠀⠀⠀⠀⠀⠀', +'⠀⠀⠀⠀⢀⣀⣾⢳⠀⠀⠀⠀⢸⢠⠃⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀', +'⣀⡤⠴⠊⠉⠀⠀⠈⠳⡀⠀⠀⠘⢎⠢⣀⣀⣀⠀⠀⠀⠀⠀⠀⠀', +'⠳⣄⠀⠀⡠⡤⡀⠀⠘⣇⡀⠀⠀⠀⠉⠓⠒⠺⠭⢵⣦⡀⠀⠀⠀', +'⠀⢹⡆⠀⢷⡇⠁⠀⠀⣸⠇⠀⠀⠀⠀⠀⢠⢤⠀⠀⠘⢷⣆⡀⠀', +'⠀⠀⠘⠒⢤⡄⠖⢾⣭⣤⣄⠀⡔⢢⠀⡀⠎⣸⠀⠀⠀⠀⠹⣿⡀', +'⠀⠀⢀⡤⠜⠃⠀⠀⠘⠛⣿⢸⠀⡼⢠⠃⣤⡟⠀⠀⠀⠀⠀⣿⡇', +'⠀⠀⠸⠶⠖⢏⠀⠀⢀⡤⠤⠇⣴⠏⡾⢱⡏⠁⠀⠀⠀⠀⢠⣿⠃', +'⠀⠀⠀⠀⠀⠈⣇⡀⠿⠀⠀⠀⡽⣰⢶⡼⠇⠀⠀⠀⠀⣠⣿⠟⠀', +'⠀⠀⠀⠀⠀⠀⠈⠳⢤⣀⡶⠤⣷⣅⡀⠀⠀⠀⣀⡠⢔⠕⠁⠀⠀', +'⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠙⠫⠿⠿⠿⠛⠋⠁⠀⠀⠀⠀', +'', +} + +dashboard.custom_center = { + { icon=' ', desc='Find File', action='Telescope find_files find_command=rg,--hidden,--files'}, + { icon=' ', desc='File Browser', action='Telescope file_browser'}, + { icon=' ', desc='Settings', action='e C:/Users/Leander/AppData/Local/nvim/init.vim'}, +} diff --git a/nvim/plugin/lspconfig.lua b/nvim/plugin/lspconfig.lua new file mode 100644 index 0000000..80950e3 --- /dev/null +++ b/nvim/plugin/lspconfig.lua @@ -0,0 +1,38 @@ +local status, lspconfig = pcall(require, 'lspconfig') +if (not status) then return end + + + +lspconfig.pyright.setup {} + +lspconfig.sumneko_lua.setup { + settings = { + Lua = { + diagnostics = { + -- get the language server to recognize the 'vim' globals + globals = { 'vim' } + }, + + workspace = { + libary = vim.api.nvim_get_runtime_file("", true) + } + } + } +} + +-- Diagnostic symbols in the sign column (gutter) +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 = "" }) +end + +vim.diagnostic.config({ + virtual_text = { + prefix = '●' + }, + update_in_insert = true, + float = { + source = "always", -- Or "if_many" + }, +}) diff --git a/nvim/plugin/lspkind.lua b/nvim/plugin/lspkind.lua new file mode 100644 index 0000000..6027051 --- /dev/null +++ b/nvim/plugin/lspkind.lua @@ -0,0 +1,49 @@ +require('lspkind').init({ + -- DEPRECATED (use mode instead): enables text annotations + -- + -- default: true + -- with_text = true, + + -- defines how annotations are shown + -- default: symbol + -- options: 'text', 'text_symbol', 'symbol_text', 'symbol' + mode = 'symbol_text', + + -- default symbol map + -- can be either 'default' (requires nerd-fonts font) or + -- 'codicons' for codicon preset (requires vscode-codicons font) + -- + -- default: 'default' + preset = 'codicons', + + -- override preset symbols + -- + -- default: {} + symbol_map = { + Text = "", + Method = "", + Function = "", + Constructor = "", + Field = "ﰠ", + Variable = "", + Class = "ﴯ", + Interface = "", + Module = "", + Property = "ﰠ", + Unit = "塞", + Value = "", + Enum = "", + Keyword = "", + Snippet = "", + Color = "", + File = "", + Reference = "", + Folder = "", + EnumMember = "", + Constant = "", + Struct = "פּ", + Event = "", + Operator = "", + TypeParameter = "" + }, +}) diff --git a/nvim/plugin/lspsaga.lua b/nvim/plugin/lspsaga.lua new file mode 100644 index 0000000..e215b30 --- /dev/null +++ b/nvim/plugin/lspsaga.lua @@ -0,0 +1,16 @@ +local status, saga = pcall(require, "lspsaga") +if (not status) then return end + +saga.init_lsp_saga { + server_filetype_map = { + typescript = 'typescript' + } +} + +local opts = { noremap = true, silent = true } +vim.keymap.set('n', '', 'Lspsaga diagnostic_jump_next', opts) +vim.keymap.set('n', 'K', 'Lspsaga hover_doc', opts) +vim.keymap.set('n', 'gd', 'Lspsaga lsp_finder', opts) +vim.keymap.set('i', '', 'Lspsaga signature_help', opts) +vim.keymap.set('n', 'gp', 'Lspsaga preview_definition', opts) +vim.keymap.set('n', 'gr', 'Lspsaga rename', opts) diff --git a/nvim/plugin/lualine.lua b/nvim/plugin/lualine.lua new file mode 100644 index 0000000..00a13fb --- /dev/null +++ b/nvim/plugin/lualine.lua @@ -0,0 +1,43 @@ +local status, lualine = pcall(require, 'lualine') +if (not status) then return end + +lualine.setup { + options = { + icons_enabled = true, + theme = 'auto', + component_separators = { left = '', right = ''}, + section_separators = { left = '', right = ''}, + disabled_filetypes = { + statusline = {}, + winbar = {}, + }, + ignore_focus = {}, + always_divide_middle = true, + globalstatus = false, + refresh = { + statusline = 1000, + tabline = 1000, + winbar = 1000, + } + }, + sections = { + lualine_a = {'mode'}, + lualine_b = {'branch', 'diff', 'diagnostics'}, + lualine_c = {'filename'}, + lualine_x = {'encoding', 'fileformat', 'filetype'}, + lualine_y = {'progress'}, + lualine_z = {'location'} + }, + inactive_sections = { + lualine_a = {}, + lualine_b = {}, + lualine_c = {'filename'}, + lualine_x = {'location'}, + lualine_y = {}, + lualine_z = {} + }, + tabline = {}, + winbar = {}, + inactive_winbar = {}, + extensions = {} +} diff --git a/nvim/plugin/mason.lua b/nvim/plugin/mason.lua new file mode 100644 index 0000000..91952e4 --- /dev/null +++ b/nvim/plugin/mason.lua @@ -0,0 +1,24 @@ +local status, mason = pcall(require, 'mason') +if (not status) then return end + +local status2, masonlspconfig = pcall(require, 'mason-lspconfig') +if (not status2) then return end + +mason.setup({ + ui = { + icons = { + package_installed = "✓", + package_pending = "➜", + package_uninstalled = "✗" + } + } +}) + +masonlspconfig.setup { + + ensure_installed = {}, + + -- false: Servers are not automatically installed. + -- true: All servers set up via lspconfig are automatically installed. + automatic_installation = false, +} diff --git a/nvim/plugin/telescope.lua b/nvim/plugin/telescope.lua new file mode 100644 index 0000000..37b9b86 --- /dev/null +++ b/nvim/plugin/telescope.lua @@ -0,0 +1,78 @@ +local status, telescope = pcall(require, "telescope") +if (not status) then return end +local actions = require('telescope.actions') +local builtin = require("telescope.builtin") + +local function telescope_buffer_dir() + return vim.fn.expand('%:p:h') +end + +local fb_actions = require "telescope".extensions.file_browser.actions + +telescope.setup { + defaults = { + mappings = { + n = { + ["q"] = actions.close + }, + }, + }, + extensions = { + file_browser = { + theme = "dropdown", + -- disables netrw and use telescope-file-browser in its place + hijack_netrw = true, + mappings = { + -- your custom insert mode mappings + ["i"] = { + [""] = function() vim.cmd('normal vbd') end, + }, + ["n"] = { + -- your custom normal mode mappings + ["N"] = fb_actions.create, + ["h"] = fb_actions.goto_parent_dir, + ["/"] = function() + vim.cmd('startinsert') + end + }, + }, + }, + }, +} + +telescope.load_extension("file_browser") + +vim.keymap.set('n', ';f', + function() + builtin.find_files({ + no_ignore = false, + hidden = true + }) + end) +vim.keymap.set('n', ';r', function() + builtin.live_grep() +end) +vim.keymap.set('n', '\\\\', function() + builtin.buffers() +end) +vim.keymap.set('n', ';t', function() + builtin.help_tags() +end) +vim.keymap.set('n', ';;', function() + builtin.resume() +end) +vim.keymap.set('n', ';e', function() + builtin.diagnostics() +end) +vim.keymap.set("n", "sf", function() + telescope.extensions.file_browser.file_browser({ + path = "%:p:h", + cwd = telescope_buffer_dir(), + respect_gitignore = false, + hidden = true, + grouped = true, + previewer = false, + initial_mode = "normal", + layout_config = { height = 40 } + }) +end) \ No newline at end of file diff --git a/nvim/plugin/treesitter.lua b/nvim/plugin/treesitter.lua new file mode 100644 index 0000000..a6b3c40 --- /dev/null +++ b/nvim/plugin/treesitter.lua @@ -0,0 +1,23 @@ +local status, ts = pcall(require, 'treesitter') +if (not status) then return end + +ts.setup { + highlight = { + enable = true, + disable = {} + }, + indent = { + enable = true, + disable = {} + }, + ensure_installed = { + 'lua', + 'python', + "css", + "html", + "json", + }, + autotag = { + enable = true, + }, +} diff --git a/nvim/plugin/web-devicons.lua b/nvim/plugin/web-devicons.lua new file mode 100644 index 0000000..536b57f --- /dev/null +++ b/nvim/plugin/web-devicons.lua @@ -0,0 +1,12 @@ +local status, icons = pcall(require, 'nvim-web-devicons') +if (not status) then return end + +icons.setup { + -- your personnal icons can go here (to override) + -- DevIcon will be appended to `name` + override = { + }, + -- globally enable default icons (default to false) + -- will get overriden by `get_icons` option + default = true +} diff --git a/nvim/plugin/zen-mode.lua b/nvim/plugin/zen-mode.lua new file mode 100644 index 0000000..a973262 --- /dev/null +++ b/nvim/plugin/zen-mode.lua @@ -0,0 +1,7 @@ +local status, zenMode = pcall(require, "zen-mode") +if (not status) then return end + +zenMode.setup { +} + +vim.keymap.set('n', 'o', 'ZenMode', { silent = true }) -- cgit v1.3.1