updated nvim config
This commit is contained in:
parent
8b57b65974
commit
8b7a1cf657
@ -1,28 +1,30 @@
|
||||
-- -- -- Setup nvim-cmp.
|
||||
-- local status_ok, npairs = pcall(require, "nvim-autopairs")
|
||||
-- if not status_ok then
|
||||
-- return
|
||||
-- -- import nvim-autopairs safely
|
||||
-- local autopairs_setup, autopairs = pcall(require, "nvim-autopairs")
|
||||
-- if not autopairs_setup 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",
|
||||
-- },
|
||||
-- -- configure autopairs
|
||||
-- autopairs.setup({
|
||||
-- check_ts = true, -- enable treesitter
|
||||
-- ts_config = {
|
||||
-- lua = { "string" }, -- don't add pairs in lua string treesitter nodes
|
||||
-- javascript = { "template_string" }, -- don't add pairs in javscript template_string treesitter nodes
|
||||
-- java = false, -- don't check treesitter on java
|
||||
-- },
|
||||
-- })
|
||||
--
|
||||
-- -- import nvim-autopairs completion functionality safely
|
||||
-- local cmp_autopairs_setup, cmp_autopairs = pcall(require, "nvim-autopairs.completion.cmp")
|
||||
-- if not cmp_autopairs_setup then
|
||||
-- return
|
||||
-- end
|
||||
--
|
||||
-- -- import nvim-cmp plugin safely (completions plugin)
|
||||
-- local cmp_setup, cmp = pcall(require, "cmp")
|
||||
-- if not cmp_setup then
|
||||
-- return
|
||||
-- end
|
||||
--
|
||||
-- -- make autopairs and completion work together
|
||||
-- cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done())
|
||||
|
@ -6,7 +6,7 @@ vim.keymap.set("n", "<leader>a", mark.add_file)
|
||||
vim.keymap.set("n", "<C-e>", ui.toggle_quick_menu)
|
||||
|
||||
|
||||
vim.keymap.set("n", "<C-h>", function() ui.nav_file(1) end)
|
||||
vim.keymap.set("n", "<C-m>", function() ui.nav_file(1) end)
|
||||
vim.keymap.set("n", "<C-t>", function() ui.nav_file(2) end)
|
||||
vim.keymap.set("n", "<C-n>", function() ui.nav_file(3) end)
|
||||
vim.keymap.set("n", "<C-s>", function() ui.nav_file(4) end)
|
||||
|
@ -28,7 +28,7 @@ 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 }),
|
||||
['<CR>'] = cmp.mapping.confirm({ select = true }),
|
||||
["<C-Space>"] = cmp.mapping.complete(),
|
||||
})
|
||||
|
||||
@ -73,6 +73,15 @@ lsp.on_attach(function(client, bufnr)
|
||||
vim.keymap.set("i", "<C-h>", vim.lsp.buf.signature_help, opts)
|
||||
end)
|
||||
|
||||
-- local cmp_autopairs_setup, cmp_autopairs = pcall(require, "nvim-autopairs.completion.cmp")
|
||||
-- if not cmp_autopairs_setup then
|
||||
-- return
|
||||
-- end
|
||||
--
|
||||
-- cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done())
|
||||
require("luasnip.loaders.from_vscode").lazy_load()
|
||||
|
||||
|
||||
lsp.setup()
|
||||
|
||||
vim.diagnostic.config({
|
||||
|
3
configs/nvim/after/plugin/tmux.lua
Normal file
3
configs/nvim/after/plugin/tmux.lua
Normal file
@ -0,0 +1,3 @@
|
||||
require'nvim-tmux-navigation'.setup {
|
||||
disable_when_zoomed = true -- defaults to false
|
||||
}
|
@ -1,21 +1,20 @@
|
||||
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,
|
||||
},
|
||||
})
|
||||
-- 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,
|
||||
-- },
|
||||
-- })
|
||||
|
@ -1,25 +1,38 @@
|
||||
require'nvim-treesitter.configs'.setup {
|
||||
-- A list of parser names, or "all"
|
||||
ensure_installed = { "help", "python", "javascript", "c", "lua", "rust", "bash" },
|
||||
require 'nvim-treesitter.configs'.setup {
|
||||
-- A list of parser names, or "all"
|
||||
ensure_installed = {
|
||||
"help",
|
||||
"python",
|
||||
"javascript",
|
||||
"c",
|
||||
"lua",
|
||||
"rust",
|
||||
"bash",
|
||||
"gitignore",
|
||||
"vim",
|
||||
"markdown",
|
||||
"html",
|
||||
"css",
|
||||
},
|
||||
|
||||
-- Install parsers synchronously (only applied to `ensure_installed`)
|
||||
sync_install = false,
|
||||
-- Install parsers synchronously (only applied to `ensure_installed`)
|
||||
sync_install = true,
|
||||
|
||||
-- Automatically install missing parsers when entering buffer
|
||||
-- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally
|
||||
auto_install = true,
|
||||
-- Automatically install missing parsers when entering buffer
|
||||
-- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally
|
||||
auto_install = true,
|
||||
|
||||
highlight = {
|
||||
-- `false` will disable the whole extension
|
||||
enable = true,
|
||||
-- Setting this to true will run `:h syntax` and tree-sitter at the same time.
|
||||
-- Set this to `true` if you depend on 'syntax' being enabled (like for indentation).
|
||||
-- Using this option may slow down your editor, and you may see some duplicate highlights.
|
||||
-- Instead of true it can also be a list of languages
|
||||
additional_vim_regex_highlighting = false,
|
||||
},
|
||||
highlight = {
|
||||
-- `false` will disable the whole extension
|
||||
enable = true,
|
||||
-- Setting this to true will run `:h syntax` and tree-sitter at the same time.
|
||||
-- Set this to `true` if you depend on 'syntax' being enabled (like for indentation).
|
||||
-- Using this option may slow down your editor, and you may see some duplicate highlights.
|
||||
-- Instead of true it can also be a list of languages
|
||||
additional_vim_regex_highlighting = false,
|
||||
},
|
||||
|
||||
autotag = {
|
||||
enable = true,
|
||||
},
|
||||
autotag = {
|
||||
enable = true,
|
||||
},
|
||||
}
|
||||
|
@ -80,7 +80,6 @@ return require('packer').startup(function(use)
|
||||
use 'xiyaowong/nvim-transparent'
|
||||
-- use {
|
||||
-- "windwp/nvim-autopairs",
|
||||
-- config = function() require("nvim-autopairs").setup ({}) end
|
||||
-- }
|
||||
use({
|
||||
'nyoom-engineering/oxocarbon.nvim',
|
||||
@ -124,11 +123,18 @@ return require('packer').startup(function(use)
|
||||
end
|
||||
})
|
||||
|
||||
use { "alexghergh/nvim-tmux-navigation" }
|
||||
|
||||
use 'windwp/nvim-ts-autotag'
|
||||
|
||||
use 'norcalli/nvim-colorizer.lua'
|
||||
use 'ThePrimeagen/vim-be-good'
|
||||
|
||||
use 'declancm/maximize.nvim'
|
||||
|
||||
use({"L3MON4D3/LuaSnip", tag = "v<CurrentMajor>.*"})
|
||||
use "rafamadriz/friendly-snippets"
|
||||
|
||||
if packer_bootstrap then
|
||||
require('packer').sync()
|
||||
end
|
||||
|
@ -1,38 +1,53 @@
|
||||
vim.keymap.set("n", "<leader>pv", vim.cmd.Ex)
|
||||
vim.keymap.set("i", "jk", "<Esc>")
|
||||
local keymap = vim.keymap
|
||||
local nvim_tmux_nav = require('nvim-tmux-navigation')
|
||||
|
||||
|
||||
keymap.set("n", "<leader>pv", vim.cmd.Ex)
|
||||
keymap.set("i", "jk", "<Esc>")
|
||||
|
||||
vim.g.mapleader = " "
|
||||
vim.keymap.set("n", "<leader>pv", vim.cmd.Ex)
|
||||
vim.keymap.set("n", "<leader>e", vim.cmd.NvimTreeToggle)
|
||||
keymap.set("n", "<leader>pv", vim.cmd.Ex)
|
||||
-- keymap.set("n", "<leader>e", vim.cmd.NreeToggle)
|
||||
|
||||
vim.keymap.set("v", "J", ":m '>+1<CR>gv=gv")
|
||||
vim.keymap.set("v", "K", ":m '<-2<CR>gv=gv")
|
||||
keymap.set("v", "J", ":m '>+1<CR>gv=gv")
|
||||
keymap.set("v", "K", ":m '<-2<CR>gv=gv")
|
||||
|
||||
vim.keymap.set("n", "J", "mzJ`z")
|
||||
vim.keymap.set("n", "<C-d>", "<C-d>zz")
|
||||
vim.keymap.set("n", "<C-u>", "<C-u>zz")
|
||||
vim.keymap.set("n", "n", "nzzzv")
|
||||
vim.keymap.set("n", "N", "Nzzzv")
|
||||
keymap.set("n", "J", "mzJ`z")
|
||||
keymap.set("n", "<C-d>", "<C-d>zz")
|
||||
keymap.set("n", "<C-u>", "<C-u>zz")
|
||||
keymap.set("n", "n", "nzzzv")
|
||||
keymap.set("n", "N", "Nzzzv")
|
||||
|
||||
vim.keymap.set("x", "<leader>p", [["_dP]])
|
||||
vim.keymap.set({ "n", "v" }, "<leader>y", [["+y]])
|
||||
vim.keymap.set("n", "<leader>Y", [["+Y]])
|
||||
vim.keymap.set({ "n", "v" }, "<leader>d", [["_d]])
|
||||
vim.keymap.set("i", "<C-c>", "<Esc>")
|
||||
keymap.set("x", "<leader>p", [["_dP]])
|
||||
keymap.set({ "n", "v" }, "<leader>y", [["+y]])
|
||||
keymap.set("n", "<leader>Y", [["+Y]])
|
||||
keymap.set({ "n", "v" }, "<leader>d", [["_d]])
|
||||
keymap.set("i", "<C-c>", "<Esc>")
|
||||
|
||||
vim.keymap.set("n", "Q", "<nop>")
|
||||
vim.keymap.set("n", "<C-f>", "<cmd>silent !tmux neww tmux-sessionizer<CR>")
|
||||
vim.keymap.set("n", "<leader>f", vim.lsp.buf.format)
|
||||
keymap.set("n", "Q", "<nop>")
|
||||
keymap.set("n", "<C-f>", "<cmd>silent !tmux neww tmux-sessionizer<CR>")
|
||||
keymap.set("n", "<leader>f", vim.lsp.buf.format)
|
||||
|
||||
vim.keymap.set("n", "<C-k>", "<cmd>cnext<CR>zz")
|
||||
vim.keymap.set("n", "<C-j>", "<cmd>cprev<CR>zz")
|
||||
vim.keymap.set("n", "<leader>k", "<cmd>lnext<CR>zz")
|
||||
vim.keymap.set("n", "<leader>j", "<cmd>lprev<CR>zz")
|
||||
keymap.set("n", "<A-k>", "<cmd>cnext<CR>zz")
|
||||
keymap.set("n", "<A-j>", "<cmd>cprev<CR>zz")
|
||||
keymap.set("n", "<leader>k", "<cmd>lnext<CR>zz")
|
||||
keymap.set("n", "<leader>j", "<cmd>lprev<CR>zz")
|
||||
|
||||
vim.keymap.set("n", "<leader>s", [[:%s/\<<C-r><C-w>\>/<C-r><C-w>/gI<Left><Left><Left>]])
|
||||
vim.keymap.set("n", "<leader>x", "<cmd>!chmod +x %<CR>", { silent = true })
|
||||
keymap.set("n", "<leader>r", [[:%s/\<<C-r><C-w>\>/<C-r><C-w>/gI<Left><Left><Left>]])
|
||||
keymap.set("n", "<leader>x", "<cmd>!chmod +x %<CR>", { silent = true })
|
||||
|
||||
vim.keymap.set("t", "<leader><Esc>", [[<C-\><C-n>]])
|
||||
keymap.set("t", "<leader><Esc>", [[<C-\><C-n>]])
|
||||
|
||||
keymap.set("n", "<leader>sv", "<C-w>v")
|
||||
keymap.set("n", "<leader>sh", "<C-w>s")
|
||||
keymap.set("n", "<leader>se", "<C-w>=")
|
||||
keymap.set("n", "<leader>sx", ":close<CR>")
|
||||
|
||||
keymap.set('n', "<C-h>", nvim_tmux_nav.NvimTmuxNavigateLeft)
|
||||
keymap.set('n', "<C-j>", nvim_tmux_nav.NvimTmuxNavigateDown)
|
||||
keymap.set('n', "<C-k>", nvim_tmux_nav.NvimTmuxNavigateUp)
|
||||
keymap.set('n', "<C-l>", nvim_tmux_nav.NvimTmuxNavigateRight)
|
||||
keymap.set('n', "<C-\\>", nvim_tmux_nav.NvimTmuxNavigateLastActive)
|
||||
keymap.set('n', "<C-Space>", nvim_tmux_nav.NvimTmuxNavigateNext)
|
||||
keymap.set('n', '<Leader>sm', "<Cmd>lua require('maximize').toggle()<CR>")
|
||||
|
||||
vim.keymap.set("n", "<C-f>", "ysst")
|
||||
vim.keymap.set("v", "<C-f>", "gSt")
|
||||
|
@ -4,7 +4,7 @@ vim.opt.mouse = 'a'
|
||||
vim.opt.nu = true
|
||||
vim.opt.relativenumber = true
|
||||
|
||||
vim.opt.clipboard:append { 'unnamedplus' }
|
||||
vim.opt.clipboard:append {'unnamedplus'}
|
||||
vim.opt.tabstop = 4
|
||||
vim.opt.softtabstop = 4
|
||||
vim.opt.shiftwidth = 4
|
||||
@ -22,7 +22,6 @@ vim.opt.undofile = true
|
||||
vim.opt.hlsearch = false
|
||||
vim.opt.incsearch = true
|
||||
|
||||
vim.opt.termguicolors = true
|
||||
|
||||
vim.opt.scrolloff = 8
|
||||
vim.opt.signcolumn = "yes"
|
||||
@ -38,6 +37,10 @@ vim.g.mapleader = " "
|
||||
-- vim.g.loaded_netrwPlugin = 1
|
||||
|
||||
-- Case insensitive searching UNLESS /C or capital in search
|
||||
vim.o.ignorecase = true
|
||||
vim.o.completeopt = 'menuone,noselect'
|
||||
vim.o.smartcase = true
|
||||
vim.opt.ignorecase = true
|
||||
vim.opt.completeopt = 'menuone,noselect'
|
||||
vim.opt.smartcase = true
|
||||
|
||||
vim.opt.splitright = true
|
||||
vim.opt.splitbelow = true
|
||||
vim.opt.termguicolors = true
|
||||
|
Loading…
Reference in New Issue
Block a user