diff options
| author | Nanderty <psopka@sopka.ch> | 2023-03-15 23:36:14 +0100 |
|---|---|---|
| committer | Nanderty <psopka@sopka.ch> | 2023-03-15 23:36:14 +0100 |
| commit | fba8830826fa88ef43d84fb051f90f11e4ae939b (patch) | |
| tree | 4fc0bbae7e49c9b670fc34505a8352400c0ffa8d | |
| parent | 59bd3aeee04b6ff559c51a324234a5100db0b2e1 (diff) | |
| download | neovim-config-fba8830826fa88ef43d84fb051f90f11e4ae939b.tar.gz neovim-config-fba8830826fa88ef43d84fb051f90f11e4ae939b.tar.bz2 neovim-config-fba8830826fa88ef43d84fb051f90f11e4ae939b.zip | |
cleanup
| -rw-r--r-- | ftplugin/tex/vimtex.lua (renamed from after/ftplugin/tex/vimtex.lua) | 3 | ||||
| -rw-r--r-- | init.lua | 8 | ||||
| -rw-r--r-- | lua/Nanderty/Plugins/cmp.lua | 82 | ||||
| -rw-r--r-- | lua/Nanderty/plug.lua | 17 | ||||
| m--------- | plugged/bufferline.nvim | 0 | ||||
| m--------- | plugged/cmp-buffer | 0 | ||||
| m--------- | plugged/cmp-cmdline | 0 | ||||
| m--------- | plugged/cmp-nvim-lsp | 0 | ||||
| m--------- | plugged/cmp-nvim-ultisnips | 0 | ||||
| m--------- | plugged/cmp-path | 0 | ||||
| m--------- | plugged/lualine.nvim | 0 | ||||
| m--------- | plugged/mason-lspconfig.nvim | 0 | ||||
| m--------- | plugged/mason.nvim | 0 | ||||
| m--------- | plugged/mini.nvim | 0 | ||||
| m--------- | plugged/neoformat | 0 | ||||
| m--------- | plugged/nvim-cmp | 0 | ||||
| m--------- | plugged/nvim-lspconfig | 0 | ||||
| m--------- | plugged/nvim-treesitter | 0 | ||||
| m--------- | plugged/nvim-web-devicons | 0 | ||||
| m--------- | plugged/onedark.nvim | 0 | ||||
| m--------- | plugged/plenary.nvim | 0 | ||||
| m--------- | plugged/telescope.nvim | 0 | ||||
| m--------- | plugged/ultisnips | 0 | ||||
| m--------- | plugged/vim-fugitive | 0 | ||||
| m--------- | plugged/vimtex | 0 | ||||
| -rw-r--r-- | plugin/bufferline.lua (renamed from lua/Nanderty/Plugins/bufferline.lua) | 1 | ||||
| -rw-r--r-- | plugin/cmp.lua | 88 | ||||
| -rw-r--r-- | plugin/lspconfig.lua | 20 | ||||
| -rw-r--r-- | plugin/lualine.lua (renamed from lua/Nanderty/Plugins/lualine.lua) | 0 | ||||
| -rw-r--r-- | plugin/luasnip.lua | 5 | ||||
| -rw-r--r-- | plugin/mini.lua (renamed from lua/Nanderty/Plugins/mini.lua) | 0 | ||||
| -rw-r--r-- | plugin/neoformat.lua (renamed from lua/Nanderty/Plugins/neoformat.lua) | 0 | ||||
| -rw-r--r-- | plugin/neomake.lua | 1 | ||||
| -rw-r--r-- | plugin/telescope.lua (renamed from lua/Nanderty/Plugins/telescope.lua) | 0 | ||||
| -rw-r--r-- | plugin/treesitter.lua (renamed from lua/Nanderty/Plugins/treesitter.lua) | 2 | ||||
| -rw-r--r-- | tags | 39 |
36 files changed, 165 insertions, 101 deletions
diff --git a/after/ftplugin/tex/vimtex.lua b/ftplugin/tex/vimtex.lua index 774d3eb..d049ea4 100644 --- a/after/ftplugin/tex/vimtex.lua +++ b/ftplugin/tex/vimtex.lua @@ -1,5 +1,6 @@ vim.g.tex_flavor='latex' vim.g.vimtex_quickfix_open_on_warning = 0 - +vim.g.conceallevel=1 +vim.g.tex_conceal='abdmg' vim.keymap.set('n', '<leader>ll', '<Cmd>VimtexCompile<CR>', {} ) @@ -2,11 +2,3 @@ require('Nanderty.plug') require('Nanderty.general') require('Nanderty.remap') - -require('Nanderty.Plugins.lualine') -require('Nanderty.Plugins.telescope') -require('Nanderty.Plugins.bufferline') -require('Nanderty.Plugins.mini') -require('Nanderty.Plugins.cmp') -require('Nanderty.Plugins.treesitter') -require('Nanderty.Plugins.neoformat') diff --git a/lua/Nanderty/Plugins/cmp.lua b/lua/Nanderty/Plugins/cmp.lua deleted file mode 100644 index b9f2095..0000000 --- a/lua/Nanderty/Plugins/cmp.lua +++ /dev/null @@ -1,82 +0,0 @@ -require('mason').setup() - -require('mason-lspconfig').setup({ - ensure_installed = { - } -}) - -local lsp_capabilities = require('cmp_nvim_lsp').default_capabilities() -local lsp_attach = function(client, bufnr) -end - -local lspconfig = require('lspconfig') -require('mason-lspconfig').setup_handlers({ - function(server_name) - lspconfig[server_name].setup({ - on_attach = lsp_attach, - capabilities = lsp_capabilities, - }) - end, -}) - -local cmp = require'cmp' - -cmp.setup({ - snippet = { - expand = function(args) - vim.fn["UltiSnips#Anon"](args.body) - end, - }, - window = { - }, - mapping = cmp.mapping.preset.insert({ - ["<Tab>"] = cmp.mapping(function(fallback) - if vim.fn.pumvisible() == 1 then - feedkey("<C-n>", "n") - elseif cmp.visible() then - cmp.select_next_item() - else - fallback() - end - end, { - "i", - }), - ["<S-Tab>"] = cmp.mapping(function(fallback) - if vim.fn.pumvisible() == 1 then - feedkey("<C-p>", "n") - elseif cmp.visible() then - cmp.select_prev_item() - else - fallback() - end - end, { - "i", -}), -['<C-b>'] = cmp.mapping.scroll_docs(-4), -['<C-f>'] = cmp.mapping.scroll_docs(4), -['<C-Space>'] = cmp.mapping.complete(), -['<C-e>'] = cmp.mapping.abort(), -['<CR>'] = cmp.mapping.confirm({ select = true }), - }), - sources = cmp.config.sources({ - { name = 'nvim_lsp' }, - { name = 'ultisnips' }, - { name = 'omni' }, - { name = 'buffer' }, - }) -}) - -local lsp_capabilities = require('cmp_nvim_lsp').default_capabilities() -local lsp_attach = function(client, bufnr) - -- Create your keybindings here... -end - -local lspconfig = require('lspconfig') -require('mason-lspconfig').setup_handlers({ - function(server_name) - lspconfig[server_name].setup({ - on_attach = lsp_attach, - capabilities = lsp_capabilities, - }) - end, -}) diff --git a/lua/Nanderty/plug.lua b/lua/Nanderty/plug.lua index 4bb4b5e..1c778a0 100644 --- a/lua/Nanderty/plug.lua +++ b/lua/Nanderty/plug.lua @@ -1,21 +1,22 @@ local Plug = vim.fn['plug#'] -vim.call("plug#begin", "~/AppData/local/nvim/plugged") +vim.call('plug#begin', vim.fn.stdpath('data')..'/Plugged') Plug 'echasnovski/mini.nvim' Plug 'tpope/vim-fugitive' +Plug 'ludovicchabant/vim-gutentags' +Plug 'sbdchd/neoformat' +Plug 'neomake/neomake' + Plug 'nvim-lua/plenary.nvim' Plug('nvim-telescope/telescope.nvim', {branch = '0.1.x'}) Plug('akinsho/bufferline.nvim', {tag = 'v3.*'}) Plug 'nvim-lualine/lualine.nvim' Plug 'kyazdani42/nvim-web-devicons' - -Plug 'navarasu/onedark.nvim' - Plug('nvim-treesitter/nvim-treesitter', {run = ':TSUpdate'}) +Plug 'navarasu/onedark.nvim' Plug 'lervag/vimtex' -Plug 'sbdchd/neoformat' Plug 'neovim/nvim-lspconfig' Plug 'williamboman/mason.nvim' Plug 'williamboman/mason-lspconfig.nvim' @@ -26,7 +27,7 @@ Plug 'hrsh7th/cmp-path' Plug 'hrsh7th/cmp-cmdline' Plug 'hrsh7th/nvim-cmp' -Plug 'SirVer/ultisnips' -Plug 'quangnguyen30192/cmp-nvim-ultisnips' +Plug 'L3MON4D3/LuaSnip' +Plug 'saadparwaiz1/cmp_luasnip' -vim.call("plug#end") +vim.call('plug#end') diff --git a/plugged/bufferline.nvim b/plugged/bufferline.nvim deleted file mode 160000 -Subproject b337fd393cef2e3679689d220e2628722c20ddc diff --git a/plugged/cmp-buffer b/plugged/cmp-buffer deleted file mode 160000 -Subproject 3022dbc9166796b644a841a02de8dd1cc1d311f diff --git a/plugged/cmp-cmdline b/plugged/cmp-cmdline deleted file mode 160000 -Subproject 8fcc934a52af96120fe26358985c10c035984b5 diff --git a/plugged/cmp-nvim-lsp b/plugged/cmp-nvim-lsp deleted file mode 160000 -Subproject 0e6b2ed705ddcff9738ec4ea838141654f12eee diff --git a/plugged/cmp-nvim-ultisnips b/plugged/cmp-nvim-ultisnips deleted file mode 160000 -Subproject 43b69a235b2dc54db692049fe0d5cc60c6b58b4 diff --git a/plugged/cmp-path b/plugged/cmp-path deleted file mode 160000 -Subproject 91ff86cd9c29299a64f968ebb45846c485725f2 diff --git a/plugged/lualine.nvim b/plugged/lualine.nvim deleted file mode 160000 -Subproject e99d733e0213ceb8f548ae6551b04ae32e590c8 diff --git a/plugged/mason-lspconfig.nvim b/plugged/mason-lspconfig.nvim deleted file mode 160000 -Subproject a81503f0019942111fe464209237f8b4e85f468 diff --git a/plugged/mason.nvim b/plugged/mason.nvim deleted file mode 160000 -Subproject 10ff879fc56160e10437da5c1ca558371ddb698 diff --git a/plugged/mini.nvim b/plugged/mini.nvim deleted file mode 160000 -Subproject 1adfdeb899df23fe740fc8596e6513445f8042b diff --git a/plugged/neoformat b/plugged/neoformat deleted file mode 160000 -Subproject 891fad5829f91cbc3d0866f7abd028d233b8763 diff --git a/plugged/nvim-cmp b/plugged/nvim-cmp deleted file mode 160000 -Subproject feed47fd1da7a1bad2c7dca456ea19c8a5a9823 diff --git a/plugged/nvim-lspconfig b/plugged/nvim-lspconfig deleted file mode 160000 -Subproject 4bb0f1845c5cc6465aecedc773fc2d619fcd8fa diff --git a/plugged/nvim-treesitter b/plugged/nvim-treesitter deleted file mode 160000 -Subproject 834f1dcb8736c82b1269227b4bfe830310b5b6a diff --git a/plugged/nvim-web-devicons b/plugged/nvim-web-devicons deleted file mode 160000 -Subproject 4ee637e0b1873efe1e901380f232799fa076487 diff --git a/plugged/onedark.nvim b/plugged/onedark.nvim deleted file mode 160000 -Subproject 4497678c6b1847b663c4b23000d55f28a2f846c diff --git a/plugged/plenary.nvim b/plugged/plenary.nvim deleted file mode 160000 -Subproject 253d34830709d690f013daf2853a9d21ad7acca diff --git a/plugged/telescope.nvim b/plugged/telescope.nvim deleted file mode 160000 -Subproject 766a45a972408f67e793a3b63e3c419ff545875 diff --git a/plugged/ultisnips b/plugged/ultisnips deleted file mode 160000 -Subproject 0ad238b1910d447476b2d98f593322c1cdb7128 diff --git a/plugged/vim-fugitive b/plugged/vim-fugitive deleted file mode 160000 -Subproject 5b52a0f395065d6cb7b65a00a5e17eaf9ebd64d diff --git a/plugged/vimtex b/plugged/vimtex deleted file mode 160000 -Subproject c39907f3caad8157b5b5fb628e9d035a8aee7d7 diff --git a/lua/Nanderty/Plugins/bufferline.lua b/plugin/bufferline.lua index c5accc7..1c295dc 100644 --- a/lua/Nanderty/Plugins/bufferline.lua +++ b/plugin/bufferline.lua @@ -1,2 +1 @@ -vim.opt.termguicolors = true require("bufferline").setup{} diff --git a/plugin/cmp.lua b/plugin/cmp.lua new file mode 100644 index 0000000..56b25f5 --- /dev/null +++ b/plugin/cmp.lua @@ -0,0 +1,88 @@ +local luasnip = require('luasnip') +local cmp = require'cmp' + +local has_words_before = function() + unpack = unpack or table.unpack + local line, col = unpack(vim.api.nvim_win_get_cursor(0)) + return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match('%s') == nil +end + +local kind_icons = { + 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 = "" +} + +cmp.setup({ + snippet = { + expand = function(args) + require('luasnip').lsp_expand(args.body) + end, + }, + window = { + }, + mapping = cmp.mapping.preset.insert({ + ['<Tab>'] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_next_item() + elseif luasnip.expand_or_jumpable() then + luasnip.expand_or_jump() + elseif has_words_before() then + cmp.complete() + 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 = cmp.config.sources({ + { name = 'nvim_lsp' }, + { name = 'luasnip' }, + { name = 'omni' }, + { name = 'buffer' }, + }), + formatting = { + format = function(entry, vim_item) + vim_item.kind = string.format('%s %s', kind_icons[vim_item.kind], vim_item.kind) + vim_item.menu = ({ + buffer = "[Buffer]", + nvim_lsp = "[LSP]", + luasnip = "[LuaSnip]", + nvim_lua = "[Lua]", + latex_symbols = "[LaTeX]", + })[entry.source.name] + return vim_item + end + }, +}) diff --git a/plugin/lspconfig.lua b/plugin/lspconfig.lua new file mode 100644 index 0000000..398d1ae --- /dev/null +++ b/plugin/lspconfig.lua @@ -0,0 +1,20 @@ +require('mason').setup() + +require('mason-lspconfig').setup({ + ensure_installed = { + } +}) + +local lsp_capabilities = require('cmp_nvim_lsp').default_capabilities() +local lsp_attach = function(client, bufnr) +end + +local lspconfig = require('lspconfig') +require('mason-lspconfig').setup_handlers({ + function(server_name) + lspconfig[server_name].setup({ + on_attach = lsp_attach, + capabilities = lsp_capabilities, + }) + end, +}) diff --git a/lua/Nanderty/Plugins/lualine.lua b/plugin/lualine.lua index 5ace147..5ace147 100644 --- a/lua/Nanderty/Plugins/lualine.lua +++ b/plugin/lualine.lua diff --git a/plugin/luasnip.lua b/plugin/luasnip.lua new file mode 100644 index 0000000..9d273ba --- /dev/null +++ b/plugin/luasnip.lua @@ -0,0 +1,5 @@ +require('luasnip').config.set_config({ + enable_autosnippets = true, +}) + +require('luasnip.loaders.from_lua').load({paths = vim.fn.stdpath('config')..'/Snippets'}) diff --git a/lua/Nanderty/Plugins/mini.lua b/plugin/mini.lua index 0546fe3..0546fe3 100644 --- a/lua/Nanderty/Plugins/mini.lua +++ b/plugin/mini.lua diff --git a/lua/Nanderty/Plugins/neoformat.lua b/plugin/neoformat.lua index 54ed27d..54ed27d 100644 --- a/lua/Nanderty/Plugins/neoformat.lua +++ b/plugin/neoformat.lua diff --git a/plugin/neomake.lua b/plugin/neomake.lua new file mode 100644 index 0000000..fd60d55 --- /dev/null +++ b/plugin/neomake.lua @@ -0,0 +1 @@ +vim.call('neomake#configure#automake', 'nrwi', '500') diff --git a/lua/Nanderty/Plugins/telescope.lua b/plugin/telescope.lua index 4806008..4806008 100644 --- a/lua/Nanderty/Plugins/telescope.lua +++ b/plugin/telescope.lua diff --git a/lua/Nanderty/Plugins/treesitter.lua b/plugin/treesitter.lua index 2eef668..aa15ceb 100644 --- a/lua/Nanderty/Plugins/treesitter.lua +++ b/plugin/treesitter.lua @@ -1,5 +1,5 @@ require'nvim-treesitter.configs'.setup { - ensure_installed = {"help", "javascript", "html", "css", "python", "cpp", "c", "lua", "php",}, + ensure_installed = {"help", "javascript", "css", "python", "cpp", "c", "lua", "php",}, sync_install = false, @@ -0,0 +1,39 @@ +!_TAG_EXTRA_DESCRIPTION anonymous /Include tags for non-named objects like lambda/ +!_TAG_EXTRA_DESCRIPTION fileScope /Include tags of file scope/ +!_TAG_EXTRA_DESCRIPTION pseudo /Include pseudo tags/ +!_TAG_EXTRA_DESCRIPTION subparser /Include tags generated by subparsers/ +!_TAG_FIELD_DESCRIPTION epoch /the last modified time of the input file (only for F\/file kind tag)/ +!_TAG_FIELD_DESCRIPTION file /File-restricted scoping/ +!_TAG_FIELD_DESCRIPTION input /input file/ +!_TAG_FIELD_DESCRIPTION name /tag name/ +!_TAG_FIELD_DESCRIPTION pattern /pattern/ +!_TAG_FIELD_DESCRIPTION typeref /Type and name of a variable or typedef/ +!_TAG_FILE_FORMAT 2 /extended format; --format=1 will not append ;" to lines/ +!_TAG_FILE_SORTED 1 /0=unsorted, 1=sorted, 2=foldcase/ +!_TAG_KIND_DESCRIPTION!Lua f,function /functions/ +!_TAG_KIND_DESCRIPTION!Markdown S,subsection /level 2 sections/ +!_TAG_KIND_DESCRIPTION!Markdown T,l4subsection /level 4 sections/ +!_TAG_KIND_DESCRIPTION!Markdown c,chapter /chapters/ +!_TAG_KIND_DESCRIPTION!Markdown n,footnote /footnotes/ +!_TAG_KIND_DESCRIPTION!Markdown s,section /sections/ +!_TAG_KIND_DESCRIPTION!Markdown t,subsubsection /level 3 sections/ +!_TAG_KIND_DESCRIPTION!Markdown u,l5subsection /level 5 sections/ +!_TAG_OUTPUT_EXCMD mixed /number, pattern, mixed, or combineV2/ +!_TAG_OUTPUT_FILESEP slash /slash or backslash/ +!_TAG_OUTPUT_MODE u-ctags /u-ctags or e-ctags/ +!_TAG_OUTPUT_VERSION 0.0 /current.age/ +!_TAG_PARSER_VERSION!Lua 0.0 /current.age/ +!_TAG_PARSER_VERSION!Markdown 0.0 /current.age/ +!_TAG_PATTERN_LENGTH_LIMIT 96 /0 for no limit/ +!_TAG_PROC_CWD C:/Users/Nanderty/AppData/Local/nvim/ // +!_TAG_PROGRAM_AUTHOR Universal Ctags Team // +!_TAG_PROGRAM_NAME Universal Ctags /Derived from Exuberant Ctags/ +!_TAG_PROGRAM_URL https://ctags.io/ /official site/ +!_TAG_PROGRAM_VERSION 6.0.0 /p6.0.20230312.0/ +Nanderty-Neovim-Config ./README.md /^# Nanderty-Neovim-Config$/;" c +['<S-Tab>'] ./plugin/cmp.lua /^ ['<S-Tab>'] = cmp.mapping(function(fallback)$/;" f +['<Tab>'] ./plugin/cmp.lua /^ ['<Tab>'] = cmp.mapping(function(fallback)$/;" f +expand ./plugin/cmp.lua /^ expand = function(args)$/;" f +format ./plugin/cmp.lua /^ format = function(entry, vim_item)$/;" f +has_words_before ./plugin/cmp.lua /^local has_words_before = function()$/;" f +lsp_attach ./plugin/lspconfig.lua /^local lsp_attach = function(client, bufnr)$/;" f |
