aboutsummaryrefslogtreecommitdiff
path: root/nvim
diff options
context:
space:
mode:
Diffstat (limited to 'nvim')
-rw-r--r--nvim/.config/nvim/init.lua21
-rw-r--r--nvim/.config/nvim/lua/user/keymaps.lua10
-rw-r--r--nvim/.config/nvim/lua/user/options.lua5
-rw-r--r--nvim/.config/nvim/lua/user/plugins.lua19
-rw-r--r--nvim/.config/nvim/plugin/packer_compiled.lua20
5 files changed, 55 insertions, 20 deletions
diff --git a/nvim/.config/nvim/init.lua b/nvim/.config/nvim/init.lua
index 3778a50..17ddae3 100644
--- a/nvim/.config/nvim/init.lua
+++ b/nvim/.config/nvim/init.lua
@@ -1,4 +1,3 @@
-
-- Set colorscheme
vim.cmd [[colorscheme catppuccin-mocha]]
@@ -19,20 +18,20 @@ vim.api.nvim_create_autocmd('TextYankPost', {
require('Comment').setup()
-- Enable `lukas-reineke/indent-blankline.nvim`
-require('indent_blankline').setup {
- char = '|',
- show_trailing_blankline_indent = false,
-}
+ require('indent_blankline').setup {
+ char = '|',
+ show_trailing_blankline_indent = false,
+ }
+require "user.options"
+require "user.keymaps"
require "user.plugins"
require "user.competitest"
-require "user.bufferline"
-require "user.treesitter"
-require "user.lualine"
+require "user.cmp"
require "user.lsp"
require "user.telescope"
-require "user.keymaps"
-require "user.options"
require "user.gitsigns"
+require "user.bufferline"
+require "user.treesitter"
+require "user.lualine"
require "user.nvim-tree"
-require "user.cmp"
diff --git a/nvim/.config/nvim/lua/user/keymaps.lua b/nvim/.config/nvim/lua/user/keymaps.lua
index 0f35410..9857005 100644
--- a/nvim/.config/nvim/lua/user/keymaps.lua
+++ b/nvim/.config/nvim/lua/user/keymaps.lua
@@ -26,9 +26,15 @@ vim.keymap.set('n', '<leader>b', builtin.buffers, {})
vim.keymap.set('n', '<leader>of', builtin.oldfiles, opts)
vim.keymap.set('n', '<leader>ch', builtin.command_history, opts)
+-- undoteree
+vim.keymap.set("n", "<leader>u", vim.cmd.UndotreeToggle)
+
+
-- nohlsearch
keymap("n", "<leader>h", ":noh<CR>", opts)
+-- lsp
+vim.keymap.set('n', '<leader>lf', vim.lsp.buf.format, opts)
-- Normal --
-- Better window navigation
@@ -51,10 +57,6 @@ keymap("n", "<S-h>", ":bprevious<CR>", opts)
keymap("n", "<A-j>", "<Esc>:m .+1<CR>==gi", opts)
keymap("n", "<A-k>", "<Esc>:m .-2<CR>==gi", opts)
--- Insert --
--- Press jk fast to enter
-keymap("i", "jk", "<ESC>", opts)
-
-- Visual --
-- Stay in indent mode
keymap("v", "<", "<gv", opts)
diff --git a/nvim/.config/nvim/lua/user/options.lua b/nvim/.config/nvim/lua/user/options.lua
index b486a47..c59bfd2 100644
--- a/nvim/.config/nvim/lua/user/options.lua
+++ b/nvim/.config/nvim/lua/user/options.lua
@@ -7,6 +7,7 @@ local options = {
fileencoding = "utf-8", -- the encoding written to a file
hlsearch = true, -- highlight all matches on previous search pattern
ignorecase = true, -- ignore case in search patterns
+ paste = false, -- make inserting a new line not commented when pressing o
mouse = "a", -- allow the mouse to be used in neovim
pumheight = 10, -- pop up menu height
showmode = false, -- we don't need to see things like -- INSERT -- anymore
@@ -29,10 +30,10 @@ local options = {
relativenumber = true, -- set relative numbered lines
numberwidth = 4, -- set number column width to 2 {default 4}
signcolumn = "yes", -- always show the sign column, otherwise it would shift the text each time
- wrap = false, -- display lines as one long line
+ wrap = false, -- display lines as one long line
scrolloff = 8, -- is one of my fav
sidescrolloff = 8,
- guifont = "comic mono:h13", -- the font used in graphical neovim applications
+ guifont = "comic mono:h13", -- the font used in graphical neovim applications
}
vim.opt.shortmess:append "c"
diff --git a/nvim/.config/nvim/lua/user/plugins.lua b/nvim/.config/nvim/lua/user/plugins.lua
index 26b900f..325f4f1 100644
--- a/nvim/.config/nvim/lua/user/plugins.lua
+++ b/nvim/.config/nvim/lua/user/plugins.lua
@@ -34,6 +34,20 @@ require('packer').startup(function(use)
},
}
+ -- undo tree
+ use('mbbill/undotree')
+
+ -- vim surround
+ use('tpope/vim-surround')
+
+ -- Autopairs
+ -- use {
+ -- "windwp/nvim-autopairs",
+ -- config = function() require("nvim-autopairs").setup {
+ -- disable_filetype = {}
+ -- } end
+ -- }
+ --
use { -- Autocompletion
'hrsh7th/nvim-cmp',
requires = { 'hrsh7th/cmp-nvim-lsp', 'L3MON4D3/LuaSnip', 'saadparwaiz1/cmp_luasnip' },
@@ -65,7 +79,7 @@ require('packer').startup(function(use)
})
-- bufferline
- use {'akinsho/bufferline.nvim', tag = "v3.*", requires = 'nvim-tree/nvim-web-devicons'}
+ use { 'akinsho/bufferline.nvim', tag = "v3.*", requires = 'nvim-tree/nvim-web-devicons' }
use 'nvim-lualine/lualine.nvim' -- Fancier statusline
use 'lukas-reineke/indent-blankline.nvim' -- Add indentation guides even on blank lines
@@ -81,7 +95,7 @@ require('packer').startup(function(use)
use {
'xeluxee/competitest.nvim',
requires = 'MunifTanjim/nui.nvim',
- config = function() require'competitest'.setup() end
+ config = function() require 'competitest'.setup() end
}
-- Add custom plugins to packer from ~/.config/nvim/lua/custom/plugins.lua
@@ -115,4 +129,3 @@ vim.api.nvim_create_autocmd('BufWritePost', {
group = packer_group,
pattern = vim.fn.expand '$MYVIMRC',
})
-
diff --git a/nvim/.config/nvim/plugin/packer_compiled.lua b/nvim/.config/nvim/plugin/packer_compiled.lua
index 5f281b3..0c007dd 100644
--- a/nvim/.config/nvim/plugin/packer_compiled.lua
+++ b/nvim/.config/nvim/plugin/packer_compiled.lua
@@ -150,6 +150,12 @@ _G.packer_plugins = {
path = "/home/peng/.local/share/nvim/site/pack/packer/start/nui.nvim",
url = "https://github.com/MunifTanjim/nui.nvim"
},
+ ["nvim-autopairs"] = {
+ config = { "\27LJ\2\n@\0\0\3\0\3\0\a6\0\0\0'\2\1\0B\0\2\0029\0\2\0004\2\0\0B\0\2\1K\0\1\0\nsetup\19nvim-autopairs\frequire\0" },
+ loaded = true,
+ path = "/home/peng/.local/share/nvim/site/pack/packer/start/nvim-autopairs",
+ url = "https://github.com/windwp/nvim-autopairs"
+ },
["nvim-cmp"] = {
loaded = true,
path = "/home/peng/.local/share/nvim/site/pack/packer/start/nvim-cmp",
@@ -210,6 +216,11 @@ _G.packer_plugins = {
path = "/home/peng/.local/share/nvim/site/pack/packer/start/telescope.nvim",
url = "https://github.com/nvim-telescope/telescope.nvim"
},
+ undotree = {
+ loaded = true,
+ path = "/home/peng/.local/share/nvim/site/pack/packer/start/undotree",
+ url = "https://github.com/mbbill/undotree"
+ },
["vim-fugitive"] = {
loaded = true,
path = "/home/peng/.local/share/nvim/site/pack/packer/start/vim-fugitive",
@@ -224,6 +235,11 @@ _G.packer_plugins = {
loaded = true,
path = "/home/peng/.local/share/nvim/site/pack/packer/start/vim-sleuth",
url = "https://github.com/tpope/vim-sleuth"
+ },
+ ["vim-surround"] = {
+ loaded = true,
+ path = "/home/peng/.local/share/nvim/site/pack/packer/start/vim-surround",
+ url = "https://github.com/tpope/vim-surround"
}
}
@@ -232,6 +248,10 @@ time([[Defining packer_plugins]], false)
time([[Config for competitest.nvim]], true)
try_loadstring("\27LJ\2\n9\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\nsetup\16competitest\frequire\0", "config", "competitest.nvim")
time([[Config for competitest.nvim]], false)
+-- Config for: nvim-autopairs
+time([[Config for nvim-autopairs]], true)
+try_loadstring("\27LJ\2\n@\0\0\3\0\3\0\a6\0\0\0'\2\1\0B\0\2\0029\0\2\0004\2\0\0B\0\2\1K\0\1\0\nsetup\19nvim-autopairs\frequire\0", "config", "nvim-autopairs")
+time([[Config for nvim-autopairs]], false)
-- Conditional loads
time([[Conditional loading of telescope-fzf-native.nvim]], true)
require("packer.load")({"telescope-fzf-native.nvim"}, {}, _G.packer_plugins)