giving up on autopair
This commit is contained in:
parent
8c86699468
commit
8b57b65974
@ -1 +1,28 @@
|
||||
require("nvim-autopairs").setup()
|
||||
-- -- -- Setup nvim-cmp.
|
||||
-- local status_ok, npairs = pcall(require, "nvim-autopairs")
|
||||
-- if not status_ok then
|
||||
-- return
|
||||
-- end
|
||||
--
|
||||
-- npairs.setup({
|
||||
-- check_ts = true, -- treesitter integration
|
||||
-- disable_filetype = { "TelescopePrompt" },
|
||||
-- ts_config = {
|
||||
-- lua = { "string", "source" },
|
||||
-- javascript = { "string", "template_string" },
|
||||
-- java = false,
|
||||
-- },
|
||||
--
|
||||
-- fast_wrap = {
|
||||
-- map = "<M-e>",
|
||||
-- chars = { "{", "[", "(", '"', "'" },
|
||||
-- pattern = string.gsub([[ [%'%"%)%>%]%)%}%,] ]], "%s+", ""),
|
||||
-- offset = 0, -- Offset from pattern match
|
||||
-- end_key = "$",
|
||||
-- keys = "qwertyuiopzxcvbnmasdfghjkl",
|
||||
-- check_comma = true,
|
||||
-- highlight = "PmenuSel",
|
||||
-- highlight_grey = "LineNr",
|
||||
-- },
|
||||
-- })
|
||||
--
|
||||
|
4
configs/nvim/after/plugin/autotag.lua
Normal file
4
configs/nvim/after/plugin/autotag.lua
Normal file
@ -0,0 +1,4 @@
|
||||
local status, autotag = pcall(require, 'nvim-ts-autotag')
|
||||
if (not status) then return end
|
||||
|
||||
autotag.setup()
|
4
configs/nvim/after/plugin/colorizer.lua
Normal file
4
configs/nvim/after/plugin/colorizer.lua
Normal file
@ -0,0 +1,4 @@
|
||||
local status, colorizer = pcall(require, 'colorizer')
|
||||
if (not status) then return end
|
||||
|
||||
colorizer.setup()
|
@ -3,13 +3,14 @@ local lsp = require('lsp-zero')
|
||||
lsp.preset('recommended')
|
||||
|
||||
lsp.ensure_installed({
|
||||
'tsserver',
|
||||
'eslint',
|
||||
'pyright',
|
||||
'sumneko_lua',
|
||||
'rust_analyzer',
|
||||
'tsserver',
|
||||
'eslint',
|
||||
'pyright',
|
||||
'sumneko_lua',
|
||||
'rust_analyzer',
|
||||
})
|
||||
|
||||
|
||||
-- Fix Undefined global 'vim'
|
||||
lsp.configure('sumneko_lua', {
|
||||
settings = {
|
||||
@ -23,12 +24,12 @@ lsp.configure('sumneko_lua', {
|
||||
|
||||
|
||||
local cmp = require('cmp')
|
||||
local cmp_select = {behavior = cmp.SelectBehavior.Select}
|
||||
local cmp_select = { behavior = cmp.SelectBehavior.Select }
|
||||
local cmp_mappings = lsp.defaults.cmp_mappings({
|
||||
['<C-p>'] = cmp.mapping.select_prev_item(cmp_select),
|
||||
['<C-n>'] = cmp.mapping.select_next_item(cmp_select),
|
||||
['<C-y>'] = cmp.mapping.confirm({ select = true }),
|
||||
["<C-Space>"] = cmp.mapping.complete(),
|
||||
['<C-p>'] = cmp.mapping.select_prev_item(cmp_select),
|
||||
['<C-n>'] = cmp.mapping.select_next_item(cmp_select),
|
||||
['<C-y>'] = cmp.mapping.confirm({ select = true }),
|
||||
["<C-Space>"] = cmp.mapping.complete(),
|
||||
})
|
||||
|
||||
-- disable completion with tab
|
||||
@ -37,9 +38,11 @@ cmp_mappings['<Tab>'] = nil
|
||||
cmp_mappings['<S-Tab>'] = nil
|
||||
|
||||
lsp.setup_nvim_cmp({
|
||||
mapping = cmp_mappings
|
||||
mapping = cmp_mappings
|
||||
})
|
||||
|
||||
|
||||
|
||||
lsp.set_preferences({
|
||||
suggest_lsp_servers = false,
|
||||
sign_icons = {
|
||||
@ -51,23 +54,23 @@ lsp.set_preferences({
|
||||
})
|
||||
|
||||
lsp.on_attach(function(client, bufnr)
|
||||
local opts = {buffer = bufnr, remap = false}
|
||||
local opts = { buffer = bufnr, remap = false }
|
||||
|
||||
if client.name == "eslint" then
|
||||
vim.cmd.LspStop('eslint')
|
||||
return
|
||||
end
|
||||
if client.name == "eslint" then
|
||||
vim.cmd.LspStop('eslint')
|
||||
return
|
||||
end
|
||||
|
||||
vim.keymap.set("n", "gd", vim.lsp.buf.definition, opts)
|
||||
vim.keymap.set("n", "K", vim.lsp.buf.hover, opts)
|
||||
vim.keymap.set("n", "<leader>vws", vim.lsp.buf.workspace_symbol, opts)
|
||||
vim.keymap.set("n", "<leader>vd", vim.diagnostic.open_float, opts)
|
||||
vim.keymap.set("n", "[d", vim.diagnostic.goto_next, opts)
|
||||
vim.keymap.set("n", "]d", vim.diagnostic.goto_prev, opts)
|
||||
vim.keymap.set("n", "<leader>vca", vim.lsp.buf.code_action, opts)
|
||||
vim.keymap.set("n", "<leader>vrr", vim.lsp.buf.references, opts)
|
||||
vim.keymap.set("n", "<leader>vrn", vim.lsp.buf.rename, opts)
|
||||
vim.keymap.set("i", "<C-h>", vim.lsp.buf.signature_help, opts)
|
||||
vim.keymap.set("n", "gd", vim.lsp.buf.definition, opts)
|
||||
vim.keymap.set("n", "K", vim.lsp.buf.hover, opts)
|
||||
vim.keymap.set("n", "<leader>vws", vim.lsp.buf.workspace_symbol, opts)
|
||||
vim.keymap.set("n", "<leader>vd", vim.diagnostic.open_float, opts)
|
||||
vim.keymap.set("n", "[d", vim.diagnostic.goto_next, opts)
|
||||
vim.keymap.set("n", "]d", vim.diagnostic.goto_prev, opts)
|
||||
vim.keymap.set("n", "<leader>vca", vim.lsp.buf.code_action, opts)
|
||||
vim.keymap.set("n", "<leader>vrr", vim.lsp.buf.references, opts)
|
||||
vim.keymap.set("n", "<leader>vrn", vim.lsp.buf.rename, opts)
|
||||
vim.keymap.set("i", "<C-h>", vim.lsp.buf.signature_help, opts)
|
||||
end)
|
||||
|
||||
lsp.setup()
|
||||
@ -76,12 +79,9 @@ vim.diagnostic.config({
|
||||
virtual_text = true,
|
||||
})
|
||||
|
||||
local null_ls = require("null-ls")
|
||||
|
||||
null_ls.setup({
|
||||
sources = {
|
||||
null_ls.builtins.formatting.stylua,
|
||||
null_ls.builtins.diagnostics.eslint,
|
||||
null_ls.builtins.completion.spell,
|
||||
},
|
||||
local mason_nullls = require("mason-null-ls")
|
||||
mason_nullls.setup({
|
||||
automatic_installation = true,
|
||||
automatic_setup = true,
|
||||
})
|
||||
mason_nullls.setup_handlers({})
|
||||
|
32
configs/nvim/after/plugin/neosolarized.lua
Normal file
32
configs/nvim/after/plugin/neosolarized.lua
Normal file
@ -0,0 +1,32 @@
|
||||
local status, n = pcall(require, "neosolarized")
|
||||
if (not status) then return end
|
||||
|
||||
n.setup({
|
||||
comment_italics = true,
|
||||
})
|
||||
|
||||
local cb = require('colorbuddy.init')
|
||||
local Color = cb.Color
|
||||
local colors = cb.colors
|
||||
local Group = cb.Group
|
||||
local groups = cb.groups
|
||||
local styles = cb.styles
|
||||
|
||||
Color.new('black', '#000000')
|
||||
Group.new('CursorLine', colors.none, colors.base03, styles.NONE, colors.base1)
|
||||
Group.new('CursorLineNr', colors.yellow, colors.black, styles.NONE, colors.base1)
|
||||
Group.new('Visual', colors.none, colors.base03, styles.reverse)
|
||||
|
||||
local cError = groups.Error.fg
|
||||
local cInfo = groups.Information.fg
|
||||
local cWarn = groups.Warning.fg
|
||||
local cHint = groups.Hint.fg
|
||||
|
||||
Group.new("DiagnosticVirtualTextError", cError, cError:dark():dark():dark():dark(), styles.NONE)
|
||||
Group.new("DiagnosticVirtualTextInfo", cInfo, cInfo:dark():dark():dark(), styles.NONE)
|
||||
Group.new("DiagnosticVirtualTextWarn", cWarn, cWarn:dark():dark():dark(), styles.NONE)
|
||||
Group.new("DiagnosticVirtualTextHint", cHint, cHint:dark():dark():dark(), styles.NONE)
|
||||
Group.new("DiagnosticUnderlineError", colors.none, colors.none, styles.undercurl, cError)
|
||||
Group.new("DiagnosticUnderlineWarn", colors.none, colors.none, styles.undercurl, cWarn)
|
||||
Group.new("DiagnosticUnderlineInfo", colors.none, colors.none, styles.undercurl, cInfo)
|
||||
Group.new("DiagnosticUnderlineHint", colors.none, colors.none, styles.undercurl, cHint)
|
@ -1,30 +1,17 @@
|
||||
local null_ls = require("null-ls")
|
||||
local augroup = vim.api.nvim_create_augroup("LspFormatting", {})
|
||||
local format = null_ls.builtins.formatting
|
||||
local null_ls_status_ok, null_ls = pcall(require, "null-ls")
|
||||
if not null_ls_status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
local formatting = null_ls.builtins.formatting
|
||||
local diagnostics = null_ls.builtins.diagnostics
|
||||
|
||||
null_ls.setup({
|
||||
on_attach = function(client, bufnr)
|
||||
if client.supports_method("textDocument/formatting") then
|
||||
vim.api.nvim_clear_autocmds({ group = augroup, buffer = bufnr })
|
||||
vim.api.nvim_create_autocmd("BufWritePre", {
|
||||
group = augroup,
|
||||
buffer = bufnr,
|
||||
callback = function()
|
||||
-- on 0.8, you should use vim.lsp.buf.format({ bufnr = bufnr }) instead
|
||||
vim.lsp.buf.format({ bufnr = bufnr})
|
||||
end,
|
||||
})
|
||||
end
|
||||
end,
|
||||
debug = false,
|
||||
sources = {
|
||||
format.stylua,
|
||||
format.rustfmt,
|
||||
format.autopep8,
|
||||
format.fourmolu,
|
||||
null_ls.builtins.diagnostics.eslint,
|
||||
null_ls.builtins.completion.spell,
|
||||
formatting.prettier.with({ extra_args = {"--no-semi"}}),
|
||||
formatting.black.with({ extra_args = {"--fast"}}),
|
||||
-- formatting.rustfmt({}),
|
||||
},
|
||||
})
|
||||
|
||||
|
||||
|
||||
|
@ -4,3 +4,4 @@ vim.keymap.set('n', '<C-p>', builtin.git_files, {})
|
||||
vim.keymap.set('n', '<leader>ps', function()
|
||||
builtin.grep_string({ search = vim.fn.input("Grep > ") });
|
||||
end)
|
||||
vim.keymap.set('n', '<leader>pz', builtin.live_grep, {})
|
||||
|
@ -1 +1,21 @@
|
||||
require("nvim-tree").setup()
|
||||
require("nvim-tree").setup({
|
||||
sort_by = "case_sensitive",
|
||||
view = {
|
||||
adaptive_size = true,
|
||||
prefer_startup_root = true,
|
||||
update_focused_file = {
|
||||
{ update_root = true },
|
||||
},
|
||||
mappings = {
|
||||
list = {
|
||||
{ key = "u", action = "dir_up" },
|
||||
},
|
||||
},
|
||||
},
|
||||
renderer = {
|
||||
group_empty = true,
|
||||
},
|
||||
filters = {
|
||||
dotfiles = true,
|
||||
},
|
||||
})
|
||||
|
@ -18,4 +18,8 @@ require'nvim-treesitter.configs'.setup {
|
||||
-- Instead of true it can also be a list of languages
|
||||
additional_vim_regex_highlighting = false,
|
||||
},
|
||||
|
||||
autotag = {
|
||||
enable = true,
|
||||
},
|
||||
}
|
||||
|
@ -1,12 +1,12 @@
|
||||
local ensure_packer = function()
|
||||
local fn = vim.fn
|
||||
local install_path = fn.stdpath('data')..'/site/pack/packer/start/packer.nvim'
|
||||
if fn.empty(fn.glob(install_path)) > 0 then
|
||||
fn.system({'git', 'clone', '--depth', '1', 'https://github.com/wbthomason/packer.nvim', install_path})
|
||||
vim.cmd [[packadd packer.nvim]]
|
||||
return true
|
||||
end
|
||||
return false
|
||||
local fn = vim.fn
|
||||
local install_path = fn.stdpath('data') .. '/site/pack/packer/start/packer.nvim'
|
||||
if fn.empty(fn.glob(install_path)) > 0 then
|
||||
fn.system({ 'git', 'clone', '--depth', '1', 'https://github.com/wbthomason/packer.nvim', install_path })
|
||||
vim.cmd [[packadd packer.nvim]]
|
||||
return true
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
local packer_bootstrap = ensure_packer()
|
||||
@ -19,16 +19,16 @@ return require('packer').startup(function(use)
|
||||
use {
|
||||
'nvim-telescope/telescope.nvim', tag = '0.1.0',
|
||||
-- or , branch = '0.1.x',
|
||||
requires = { {'nvim-lua/plenary.nvim'} }
|
||||
requires = { { 'nvim-lua/plenary.nvim' } }
|
||||
}
|
||||
use({
|
||||
'rose-pine/neovim',
|
||||
as = 'rose-pine',
|
||||
config = function()
|
||||
vim.cmd('colorscheme rose-pine')
|
||||
end
|
||||
-- config = function()
|
||||
-- vim.cmd('colorscheme rose-pine')
|
||||
-- end
|
||||
})
|
||||
use('nvim-treesitter/nvim-treesitter', {run = ':TSUpdate'})
|
||||
use('nvim-treesitter/nvim-treesitter', { run = ':TSUpdate' })
|
||||
use('nvim-treesitter/playground')
|
||||
use('theprimeagen/harpoon')
|
||||
use('mbbill/undotree')
|
||||
@ -51,20 +51,21 @@ return require('packer').startup(function(use)
|
||||
'VonHeikemen/lsp-zero.nvim',
|
||||
requires = {
|
||||
-- LSP Support
|
||||
{'neovim/nvim-lspconfig'},
|
||||
{'williamboman/mason.nvim'},
|
||||
{'williamboman/mason-lspconfig.nvim'},
|
||||
{ 'neovim/nvim-lspconfig' },
|
||||
{ 'williamboman/mason.nvim' },
|
||||
{ 'williamboman/mason-lspconfig.nvim' },
|
||||
{ 'jay-babu/mason-null-ls.nvim' },
|
||||
-- Autocompletion
|
||||
{'hrsh7th/nvim-cmp'},
|
||||
{'hrsh7th/cmp-buffer'},
|
||||
{'hrsh7th/cmp-path'},
|
||||
{'saadparwaiz1/cmp_luasnip'},
|
||||
{'hrsh7th/cmp-nvim-lsp'},
|
||||
{'hrsh7th/cmp-nvim-lua'},
|
||||
{ 'hrsh7th/nvim-cmp' },
|
||||
{ 'hrsh7th/cmp-buffer' },
|
||||
{ 'hrsh7th/cmp-path' },
|
||||
{ 'saadparwaiz1/cmp_luasnip' },
|
||||
{ 'hrsh7th/cmp-nvim-lsp' },
|
||||
{ 'hrsh7th/cmp-nvim-lua' },
|
||||
-- Snippets
|
||||
{'L3MON4D3/LuaSnip'},
|
||||
{ 'L3MON4D3/LuaSnip' },
|
||||
-- Snippet Collection (Optional)
|
||||
{'rafamadriz/friendly-snippets'},
|
||||
{ 'rafamadriz/friendly-snippets' },
|
||||
}
|
||||
}
|
||||
use {
|
||||
@ -74,29 +75,61 @@ return require('packer').startup(function(use)
|
||||
end
|
||||
}
|
||||
use 'nvim-tree/nvim-web-devicons'
|
||||
use {'romgrk/barbar.nvim', wants = 'nvim-web-devicons'}
|
||||
use { 'romgrk/barbar.nvim', wants = 'nvim-web-devicons' }
|
||||
use 'feline-nvim/feline.nvim'
|
||||
use 'xiyaowong/nvim-transparent'
|
||||
use 'windwp/nvim-autopairs'
|
||||
-- use({
|
||||
-- 'nyoom-engineering/oxocarbon.nvim',
|
||||
-- as = 'oxocarbon',
|
||||
-- config = function()
|
||||
-- vim.opt.background = "dark"
|
||||
-- vim.cmd('colorscheme oxocarbon')
|
||||
-- end
|
||||
-- })
|
||||
--
|
||||
-- use {
|
||||
-- "windwp/nvim-autopairs",
|
||||
-- config = function() require("nvim-autopairs").setup ({}) end
|
||||
-- }
|
||||
use({
|
||||
'nyoom-engineering/oxocarbon.nvim',
|
||||
as = 'oxocarbon',
|
||||
config = function()
|
||||
vim.opt.background = "dark"
|
||||
-- vim.cmd('colorscheme oxocarbon')
|
||||
end
|
||||
})
|
||||
use({
|
||||
"neanias/everforest-nvim",
|
||||
-- Optional; default configuration will be used if setup isn't called.
|
||||
config = function()
|
||||
-- vim.cmd('colorscheme everforest')
|
||||
require("everforest").setup()
|
||||
end,
|
||||
})
|
||||
|
||||
use({
|
||||
"svrana/neosolarized.nvim",
|
||||
requires = {
|
||||
'tjdevries/colorbuddy.nvim'
|
||||
}
|
||||
})
|
||||
|
||||
use({
|
||||
"aurum77/live-server.nvim",
|
||||
run = function()
|
||||
require "live_server.util".install()
|
||||
end,
|
||||
cmd = { "LiveServer", "LiveServerStart", "LiveServerStop" },
|
||||
})
|
||||
|
||||
use({
|
||||
"kylechui/nvim-surround",
|
||||
tag = "*", -- Use for stability; omit to use `main` branch for the latest features
|
||||
config = function()
|
||||
require("nvim-surround").setup({
|
||||
-- Configuration here, or leave empty to use defaults
|
||||
})
|
||||
end
|
||||
})
|
||||
|
||||
use 'windwp/nvim-ts-autotag'
|
||||
|
||||
use 'norcalli/nvim-colorizer.lua'
|
||||
use 'ThePrimeagen/vim-be-good'
|
||||
|
||||
if packer_bootstrap then
|
||||
require('packer').sync()
|
||||
end
|
||||
end)
|
||||
|
||||
|
||||
-- -- Automatically source and re-compile packer whenever you save this init.lua
|
||||
-- local packer_group = vim.api.nvim_create_augroup('Packer', { clear = true })
|
||||
-- vim.api.nvim_create_autocmd('BufWritePost', {
|
||||
-- command = 'source <afile> | silent! LspStop | silent! LspStart | PackerCompile',
|
||||
-- group = packer_group,
|
||||
-- pattern = vim.fn.expand '$MYVIMRC',
|
||||
-- })
|
||||
|
@ -2,7 +2,7 @@ vim.keymap.set("n", "<leader>pv", vim.cmd.Ex)
|
||||
vim.keymap.set("i", "jk", "<Esc>")
|
||||
|
||||
vim.g.mapleader = " "
|
||||
-- vim.keymap.set("n", "<leader>pv", vim.cmd.Ex)
|
||||
vim.keymap.set("n", "<leader>pv", vim.cmd.Ex)
|
||||
vim.keymap.set("n", "<leader>e", vim.cmd.NvimTreeToggle)
|
||||
|
||||
vim.keymap.set("v", "J", ":m '>+1<CR>gv=gv")
|
||||
@ -33,3 +33,6 @@ vim.keymap.set("n", "<leader>s", [[:%s/\<<C-r><C-w>\>/<C-r><C-w>/gI<Left><Left><
|
||||
vim.keymap.set("n", "<leader>x", "<cmd>!chmod +x %<CR>", { silent = true })
|
||||
|
||||
vim.keymap.set("t", "<leader><Esc>", [[<C-\><C-n>]])
|
||||
|
||||
vim.keymap.set("n", "<C-f>", "ysst")
|
||||
vim.keymap.set("v", "<C-f>", "gSt")
|
||||
|
@ -4,6 +4,7 @@ vim.opt.mouse = 'a'
|
||||
vim.opt.nu = true
|
||||
vim.opt.relativenumber = true
|
||||
|
||||
vim.opt.clipboard:append { 'unnamedplus' }
|
||||
vim.opt.tabstop = 4
|
||||
vim.opt.softtabstop = 4
|
||||
vim.opt.shiftwidth = 4
|
||||
@ -33,8 +34,8 @@ vim.opt.updatetime = 50
|
||||
|
||||
vim.g.mapleader = " "
|
||||
|
||||
vim.g.loaded_netrw = 1
|
||||
vim.g.loaded_netrwPlugin = 1
|
||||
-- vim.g.loaded_netrw = 1
|
||||
-- vim.g.loaded_netrwPlugin = 1
|
||||
|
||||
-- Case insensitive searching UNLESS /C or capital in search
|
||||
vim.o.ignorecase = true
|
||||
|
Loading…
Reference in New Issue
Block a user