diff options
| author | Leander <80996591+m0ntagur@users.noreply.github.com> | 2022-08-13 00:27:04 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-08-13 00:27:04 +0200 |
| commit | afbf49f0a65a0ea77ecba455f17f592efe3089d8 (patch) | |
| tree | 35a7a053f07b429fe9e5de920d51ae5a0431dc76 | |
| parent | a61e457e4c14c7c16b9a545418e14722370dc10a (diff) | |
Add files via upload
| -rw-r--r-- | autopairs.lua | 6 | ||||
| -rw-r--r-- | autotag.lua | 4 | ||||
| -rw-r--r-- | cmp.lua | 34 | ||||
| -rw-r--r-- | colorizer.lua | 6 | ||||
| -rw-r--r-- | dashboard.lua | 27 | ||||
| -rw-r--r-- | init.vim | 114 | ||||
| -rw-r--r-- | lspconfig.lua | 38 | ||||
| -rw-r--r-- | lspkind.lua | 49 | ||||
| -rw-r--r-- | lspsaga.lua | 16 | ||||
| -rw-r--r-- | lualine.lua | 43 | ||||
| -rw-r--r-- | mason.lua | 24 | ||||
| -rw-r--r-- | telescope.lua | 78 | ||||
| -rw-r--r-- | treesitter.lua | 23 | ||||
| -rw-r--r-- | web-devicons.lua | 12 | ||||
| -rw-r--r-- | zen-mode.lua | 7 |
15 files changed, 481 insertions, 0 deletions
diff --git a/autopairs.lua b/autopairs.lua new file mode 100644 index 0000000..f04342b --- /dev/null +++ b/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/autotag.lua b/autotag.lua new file mode 100644 index 0000000..ac6fb8f --- /dev/null +++ b/autotag.lua @@ -0,0 +1,4 @@ +local status, autotag = pcall(require, 'nvim-ts-autotag')
+if (not status) then return end
+
+autotag.setup()
@@ -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({
+ ['<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
+ }),
+ }),
+ 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/colorizer.lua b/colorizer.lua new file mode 100644 index 0000000..62a654c --- /dev/null +++ b/colorizer.lua @@ -0,0 +1,6 @@ +local status, colorizer = pcall(require, "colorizer")
+if (not status) then return end
+
+colorizer.setup({
+ '*';
+})
diff --git a/dashboard.lua b/dashboard.lua new file mode 100644 index 0000000..fb72238 --- /dev/null +++ b/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/init.vim b/init.vim new file mode 100644 index 0000000..22da85c --- /dev/null +++ b/init.vim @@ -0,0 +1,114 @@ +" Configuration
+" ---------------------------------------
+ set encoding=UTF-8
+ set fileencoding=UTF-8
+
+ syntax on
+ set number
+ set notitle
+ set autoindent
+ set nobackup
+ set laststatus=2
+ set ignorecase
+ set smarttab
+ set breakindent
+ set shiftwidth=2
+ set showcmd
+ set ai
+ set si
+ set nowrap
+ set clipboard^=unnamed,unnamedplus
+ set termguicolors
+
+" Plugins
+" ---------------------------------------
+
+ call plug#begin()
+
+ " Themes
+ " 🏙️ TokyoNight
+ " A clean, dark Neovim theme written in Lua
+ Plug 'folke/tokyonight.nvim'
+
+ " 🌟 NeoSolarized
+ " A fixed solarized colorscheme for better truecolor support.
+ Plug 'overcache/NeoSolarized'
+
+ " Plugin
+ " 😄 DevIcons
+ " Adds file type icons to Vim plugins
+ Plug 'kyazdani42/nvim-web-devicons'
+
+ " 📏 Lualine
+ " Customizable status line
+ Plug 'nvim-lualine/lualine.nvim'
+
+ " 📄 lspconfig
+ " Language Server Protocol Configuration
+ Plug 'neovim/nvim-lspconfig'
+
+ " 📦 Mason
+ "
+ Plug 'williamboman/mason.nvim'
+ Plug 'williamboman/mason-lspconfig'
+
+ " ⚡ lspsaga
+ " A light-weight lsp plugin based on neovim's built-in lsp with a highly performant UI.
+ Plug 'glepnir/lspsaga.nvim', { 'branch': 'main' }
+
+ " 💻 CMP
+ " A completion engine plugin written in Lua
+ Plug 'hrsh7th/nvim-cmp'
+ Plug 'hrsh7th/cmp-nvim-lsp'
+ Plug 'hrsh7th/cmp-buffer'
+
+ " 🏷️ Autotag/pairs
+ "
+ Plug 'windwp/nvim-autopairs'
+ Plug 'windwp/nvim-ts-autotag'
+
+ " ✨ LuaSnip
+ " Snippet Engine for Neovim written in Lua
+ Plug 'L3MON4D3/LuaSnip'
+
+ " 📦 lspkind
+ " Adds symbol next to the autocompletion
+ Plug 'onsails/lspkind.nvim'
+
+ " 🌳 Treesitter
+ " Better highlighting
+ Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'}
+
+ " 🔭 Telescopec
+ " Find, Filter, Preview, Pick Files
+ Plug 'nvim-lua/plenary.nvim'
+ Plug 'nvim-telescope/telescope.nvim', { 'tag': '0.1.0' }
+ Plug 'nvim-telescope/telescope-file-browser.nvim'
+
+ " 🚦 Trouble
+ " A pretty list for showing diagnostics, references, telescope results, quickfix and location lists
+ " Plug 'folke/trouble.nvim'
+
+ " 🎨 Colorizer
+ " A high-performance color highlighter for Neovim
+ Plug 'norcalli/nvim-colorizer.lua'
+
+ " 🧘 Zen Mode
+ " Distraction-free coding for Neovim
+ Plug 'folke/zen-mode.nvim'
+
+ " 🎛️ Dashboard
+ " Customizable NeoVim start screen
+ Plug 'glepnir/dashboard-nvim'
+
+ call plug#end()
+
+" Theme
+" ---------------------------------------
+
+ " 🏙️ Tokyo Night Configuration
+ let g:tokyonight_style = "storm"
+ let g:tokyonight_transparent = 1
+ let g:tokyonight_transparent_sidebar = 1
+
+ colorscheme tokyonight
diff --git a/lspconfig.lua b/lspconfig.lua new file mode 100644 index 0000000..80950e3 --- /dev/null +++ b/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/lspkind.lua b/lspkind.lua new file mode 100644 index 0000000..6027051 --- /dev/null +++ b/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/lspsaga.lua b/lspsaga.lua new file mode 100644 index 0000000..e215b30 --- /dev/null +++ b/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', '<C-j>', '<Cmd>Lspsaga diagnostic_jump_next<CR>', opts)
+vim.keymap.set('n', 'K', '<Cmd>Lspsaga hover_doc<CR>', opts)
+vim.keymap.set('n', 'gd', '<Cmd>Lspsaga lsp_finder<CR>', opts)
+vim.keymap.set('i', '<C-k>', '<Cmd>Lspsaga signature_help<CR>', opts)
+vim.keymap.set('n', 'gp', '<Cmd>Lspsaga preview_definition<CR>', opts)
+vim.keymap.set('n', 'gr', '<Cmd>Lspsaga rename<CR>', opts)
diff --git a/lualine.lua b/lualine.lua new file mode 100644 index 0000000..00a13fb --- /dev/null +++ b/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/mason.lua b/mason.lua new file mode 100644 index 0000000..91952e4 --- /dev/null +++ b/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/telescope.lua b/telescope.lua new file mode 100644 index 0000000..37b9b86 --- /dev/null +++ b/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"] = {
+ ["<C-w>"] = 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/treesitter.lua b/treesitter.lua new file mode 100644 index 0000000..a6b3c40 --- /dev/null +++ b/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/web-devicons.lua b/web-devicons.lua new file mode 100644 index 0000000..536b57f --- /dev/null +++ b/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/zen-mode.lua b/zen-mode.lua new file mode 100644 index 0000000..a973262 --- /dev/null +++ b/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', '<C-w>o', '<cmd>ZenMode<cr>', { silent = true })
|
