From a1b3618949a20230032150c990ccabb115de6f47 Mon Sep 17 00:00:00 2001 From: Piyush Duggal Date: Fri, 13 Jan 2023 04:12:24 +0530 Subject: [PATCH 1/3] updated --- lua/user/coqCmp.lua | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/lua/user/coqCmp.lua b/lua/user/coqCmp.lua index 77128ce..fde43dc 100644 --- a/lua/user/coqCmp.lua +++ b/lua/user/coqCmp.lua @@ -27,19 +27,28 @@ local kind_icons = { } local servers = { - "sumneko_lua", - "cssls", - "html", - "tsserver", - "pyright", - "bashls", - "jsonls", - -- "yamlls", + "sumneko_lua", + "cssls", + "html", + "tsserver", + "pyright", + "bashls", + "jsonls", + -- "yamlls", } vim.g.coq_settings = { ['keymap.bigger_preview'] = "", ['keymap.jump_to_mark'] = "", ['display.icons.mappings'] = kind_icons, - ['clients.lsp.always_on_top'] = servers + ['clients.lsp.always_on_top'] = servers, + ['completion.skip_after'] = { "{", "}", "[", "]", ";" }, + ['display.pum.fast_close'] = false +} + + +-- coq.thirdparty config +require("coq_3p") { + { src = "nvimlua", short_name = "nLUA" }, + { src = "figlet", short_name = "BIG", fonts = { "/usr/share/figlet/fonts/DeltaCorpsPriest1.flf" } } } From aa2e00a97cbed5c29ea261506508eea3e3e84b28 Mon Sep 17 00:00:00 2001 From: Piyush Duggal Date: Fri, 13 Jan 2023 14:28:44 +0530 Subject: [PATCH 2/3] updated coq.nvim cfg --- lua/user/coqCmp.lua | 6 +++-- lua/user/lsp/null-ls.lua | 3 +-- lua/user/plugins.lua | 6 ++++- lua/user/treesitter.lua | 53 ++++++++++++++++++++-------------------- 4 files changed, 37 insertions(+), 31 deletions(-) diff --git a/lua/user/coqCmp.lua b/lua/user/coqCmp.lua index fde43dc..8c9ab52 100644 --- a/lua/user/coqCmp.lua +++ b/lua/user/coqCmp.lua @@ -43,10 +43,12 @@ vim.g.coq_settings = { ['display.icons.mappings'] = kind_icons, ['clients.lsp.always_on_top'] = servers, ['completion.skip_after'] = { "{", "}", "[", "]", ";" }, - ['display.pum.fast_close'] = false + -- ['display.pum.fast_close'] = false + ['display.preview.border'] = { { "", "NormalFloat" }, { "", "NormalFloat" }, { "", "NormalFloat" }, + { " ", "NormalFloat" }, + { "", "NormalFloat" }, { "", "NormalFloat" }, { "", "NormalFloat" }, { " ", "NormalFloat" }, }, } - -- coq.thirdparty config require("coq_3p") { { src = "nvimlua", short_name = "nLUA" }, diff --git a/lua/user/lsp/null-ls.lua b/lua/user/lsp/null-ls.lua index ee82425..723f2c6 100644 --- a/lua/user/lsp/null-ls.lua +++ b/lua/user/lsp/null-ls.lua @@ -14,11 +14,10 @@ null_ls.setup { sources = { formatting.prettier.with { extra_filetypes = { "toml" }, - extra_args = { "--double-quote", "--jsx-single-quote" }, + extra_args = { "--double-quote", "--jsx-single-quote", "--tsx-single-quote" }, }, formatting.black.with { extra_args = { "--fast" } }, formatting.stylua, - formatting.google_java_format, diagnostics.flake8, }, } diff --git a/lua/user/plugins.lua b/lua/user/plugins.lua index be10283..bcb20d4 100644 --- a/lua/user/plugins.lua +++ b/lua/user/plugins.lua @@ -95,7 +95,11 @@ return packer.startup(function(use) -- snippets use { "L3MON4D3/LuaSnip" } --snippet engine - use { "rafamadriz/friendly-snippets" } -- a bunch of snippets to use + + -- vim-react-snippets + use { 'SirVer/ultisnips'} + use { 'mlaursen/vim-react-snippets' } + -- use { "rafamadriz/friendly-snippets" } -- a bunch of snippets to use -- LSP use { "williamboman/nvim-lsp-installer" } -- simple to use language server installer diff --git a/lua/user/treesitter.lua b/lua/user/treesitter.lua index 7be0ce0..4d8cdf3 100644 --- a/lua/user/treesitter.lua +++ b/lua/user/treesitter.lua @@ -1,34 +1,35 @@ local status_ok, configs = pcall(require, "nvim-treesitter.configs") if not status_ok then - return + return end configs.setup({ - ensure_installed = "all", - -- ensure_installed = "all", -- one of "all" or a list of languages - ignore_install = { "" }, -- List of parsers to ignore installing - sync_install = false, -- install languages synchronously (only applied to `ensure_installed`) - highlight = { - enable = true, -- false will disable the whole extension - disable = { "css" }, -- list of language that will be disabled - additional_vim_highlighting = false, - }, - autopairs = { - enable = true, - }, - indent = { enable = true, disable = { "python", "css" } }, + ensure_installed = { "c", "cpp", "lua", "javascript", "typescript", "python", "bash", "cmake", "json5", "gitignore", + "css", "json", "vim", "dockerfile", "html", "css", "yaml", "markdown", "sql" }, + -- ensure_installed = "all", -- one of "all" or a list of languages + -- ignore_install = { "" }, -- List of parsers to ignore installing + sync_install = true, -- install languages synchronously (only applied to `ensure_installed`) + highlight = { + enable = true, -- false will disable the whole extension + disable = { "css" }, -- list of language that will be disabled + additional_vim_highlighting = false, + }, + autopairs = { + enable = true, + }, + indent = { enable = true, disable = { "python", "css" } }, - context_commentstring = { - enable = true, - enable_autocmd = false, - }, - rainbow = { - enable = true, - -- disable = { "jsx", "cpp" }, list of languages you want to disable the plugin for - extended_mode = true, -- Also highlight non-bracket delimiters like html tags, boolean or table: lang -> boolean - max_file_lines = nil, -- Do not enable for files with more than n lines, int - -- colors = {}, -- table of hex strings - -- termcolors = {} -- table of colour name strings - }, + context_commentstring = { + enable = true, + enable_autocmd = false, + }, + rainbow = { + enable = true, + -- disable = { "jsx", "cpp" }, list of languages you want to disable the plugin for + extended_mode = true, -- Also highlight non-bracket delimiters like html tags, boolean or table: lang -> boolean + max_file_lines = nil, -- Do not enable for files with more than n lines, int + -- colors = {}, -- table of hex strings + -- termcolors = {} -- table of colour name strings + }, autotag = { enable = true, } From 4c707b03ed25d105c27a71b24a1867b8d4fec291 Mon Sep 17 00:00:00 2001 From: Piyush Duggal Date: Fri, 13 Jan 2023 17:42:58 +0530 Subject: [PATCH 3/3] updated coq --- init.lua | 3 ++ lua/user/coqCmp.lua | 3 +- lua/user/plugins.lua | 73 +++++++++++++++++++++++++++++++++++++++----- 3 files changed, 70 insertions(+), 9 deletions(-) diff --git a/init.lua b/init.lua index 9c0fd1c..f254256 100644 --- a/init.lua +++ b/init.lua @@ -29,3 +29,6 @@ require("scope").setup() -- require "user.colorizer" vim.cmd(":COQnow --shut-up") vim.cmd(":set laststatus=3") +vim.g.UltiSnipsExpandTrigger="" +vim.g.UltiSnipsJumpForwardTrigger="" +vim.g.UltiSnipsJumpBackwardTrigger="" diff --git a/lua/user/coqCmp.lua b/lua/user/coqCmp.lua index 8c9ab52..71745aa 100644 --- a/lua/user/coqCmp.lua +++ b/lua/user/coqCmp.lua @@ -40,9 +40,10 @@ local servers = { vim.g.coq_settings = { ['keymap.bigger_preview'] = "", ['keymap.jump_to_mark'] = "", + ['keymap.eval_snips'] = "j", ['display.icons.mappings'] = kind_icons, ['clients.lsp.always_on_top'] = servers, - ['completion.skip_after'] = { "{", "}", "[", "]", ";" }, + ['completion.skip_after'] = { "{", "}", "[", "]", ";" , "(", ")"}, -- ['display.pum.fast_close'] = false ['display.preview.border'] = { { "", "NormalFloat" }, { "", "NormalFloat" }, { "", "NormalFloat" }, { " ", "NormalFloat" }, diff --git a/lua/user/plugins.lua b/lua/user/plugins.lua index bcb20d4..2da00c0 100644 --- a/lua/user/plugins.lua +++ b/lua/user/plugins.lua @@ -72,7 +72,7 @@ return packer.startup(function(use) as = "catppuccin", } -- cmp plugins - use { "hrsh7th/nvim-cmp"} -- The completion plugin + -- use { "hrsh7th/nvim-cmp"} -- The completion plugin -- use { "hrsh7th/cmp-buffer"} -- buffer completions -- use { "hrsh7th/cmp-path"} -- path completions -- use { "hrsh7th/cmp-vsnip"} @@ -81,7 +81,7 @@ return packer.startup(function(use) -- use { "hrsh7th/cmp-nvim-lsp"} -- use { "hrsh7th/cmp-nvim-lua"} - -- use "christianchiarulli/nvim-cmp" + use "christianchiarulli/nvim-cmp" -- use "hrsh7th/cmp-buffer" -- buffer completions -- use "hrsh7th/cmp-path" -- path completions -- use "hrsh7th/cmp-cmdline" -- cmdline completions @@ -98,9 +98,44 @@ return packer.startup(function(use) -- vim-react-snippets use { 'SirVer/ultisnips'} - use { 'mlaursen/vim-react-snippets' } + use { 'epilande/vim-react-snippets' } + use {'honza/vim-snippets'} -- use { "rafamadriz/friendly-snippets" } -- a bunch of snippets to use + -- Pum popup + use { "Shougo/pum.vim" } + + use { + "smjonas/snippet-converter.nvim", + -- SnippetConverter uses semantic versioning. Example: use version = "1.*" to avoid breaking changes on version 1. + -- Uncomment the next line to follow stable releases only. + -- tag = "*", + config = function() + local template = { + -- name = "t1", (optionally give your template a name to refer to it in the `ConvertSnippets` command) + sources = { + ultisnips = { + -- Add snippets from (plugin) folders or individual files on your runtimepath... + "./vim-snippets/UltiSnips", + -- ...or use absolute paths on your system. + }, + }, + output = { + -- Specify the output formats and paths + vscode_luasnip = { + vim.fn.stdpath("config") .. "/UltiSnips", + }, + }, + } + + require("snippet_converter").setup { + templates = { template }, + -- To change the default settings (see configuration section in the documentation) + -- settings = {}, + } + end +} + -- LSP use { "williamboman/nvim-lsp-installer" } -- simple to use language server installer use { "neovim/nvim-lspconfig" } -- enable LSP @@ -165,11 +200,33 @@ return packer.startup(function(use) -- startup Time use { "dstein64/vim-startuptime" } - use { "abecodes/tabout.nvim", - wants = { 'nvim-treesitter' }, -- or require if not used so far - after = { 'nvim-cmp' } -- if a completion plugin is using tabs load it before - } - +use { + 'abecodes/tabout.nvim', + config = function() + require('tabout').setup { + tabkey = '', -- key to trigger tabout, set to an empty string to disable + backwards_tabkey = '', -- key to trigger backwards tabout, set to an empty string to disable + act_as_tab = true, -- shift content if tab out is not possible + act_as_shift_tab = false, -- reverse shift content if tab out is not possible (if your keyboard/terminal supports ) + default_tab = '', -- shift default action (only at the beginning of a line, otherwise is used) + default_shift_tab = '', -- reverse shift default action, + enable_backwards = true, -- well ... + completion = true, -- if the tabkey is used in a completion pum + tabouts = { + {open = "'", close = "'"}, + {open = '"', close = '"'}, + {open = '`', close = '`'}, + {open = '(', close = ')'}, + {open = '[', close = ']'}, + {open = '{', close = '}'} + }, + ignore_beginning = true, --[[ if the cursor is at the beginning of a filled element it will rather tab out than shift the content ]] + exclude = {} -- tabout will ignore these filetypes +} + end, + wants = {'nvim-treesitter'}, -- or require if not used so far + after = {'nvim-cmp'} -- if a completion plugin is using tabs load it before +} -- -- Color Shower use { "norcalli/nvim-colorizer.lua" }