feat!: add new plugins, configs. rm flash
This commit is contained in:
		
							parent
							
								
									1aedb8a474
								
							
						
					
					
						commit
						7e6818319e
					
				
							
								
								
									
										3
									
								
								init.lua
									
									
									
									
									
								
							
							
						
						
									
										3
									
								
								init.lua
									
									
									
									
									
								
							| @ -18,11 +18,12 @@ vim.api.nvim_create_autocmd('User', { | |||||||
| 	callback = function() | 	callback = function() | ||||||
| 		vim.cmd 'colorscheme neogruber' | 		vim.cmd 'colorscheme neogruber' | ||||||
| 		require 'feline' | 		require 'feline' | ||||||
| 		require 'flash' |  | ||||||
| 		require 'config.mappings' | 		require 'config.mappings' | ||||||
| 		require 'config.autocmd' | 		require 'config.autocmd' | ||||||
| 		require 'nvim-treesitter' | 		require 'nvim-treesitter' | ||||||
| 		require 'dressing' | 		require 'dressing' | ||||||
|  | 		require 'NeoSwap' | ||||||
|  | 		require 'nvim-peekup' | ||||||
| 	end, | 	end, | ||||||
| }) | }) | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -10,8 +10,8 @@ vim.api.nvim_create_autocmd({ 'FileType' }, { | |||||||
| 	pattern = { 'qf', 'help', 'man', 'lspinfo', 'spectre_panel', 'lir' }, | 	pattern = { 'qf', 'help', 'man', 'lspinfo', 'spectre_panel', 'lir' }, | ||||||
| 	callback = function() | 	callback = function() | ||||||
| 		vim.cmd [[ | 		vim.cmd [[ | ||||||
|       nnoremap <silent> <buffer> q :close<CR>  |       nnoremap <silent> <buffer> q :close<CR> | ||||||
|       set nobuflisted  |       set nobuflisted | ||||||
|     ]] |     ]] | ||||||
| 	end, | 	end, | ||||||
| }) | }) | ||||||
| @ -40,14 +40,14 @@ vim.api.nvim_create_autocmd({ 'TextYankPost' }, { | |||||||
| 	end, | 	end, | ||||||
| }) | }) | ||||||
| 
 | 
 | ||||||
| vim.api.nvim_create_augroup('diagnostics', { clear = true }) | -- vim.api.nvim_create_augroup('diagnostics', { clear = true }) | ||||||
| 
 | -- | ||||||
| vim.api.nvim_create_autocmd({ 'DiagnosticChanged' }, { | -- vim.api.nvim_create_autocmd({ 'DiagnosticChanged' }, { | ||||||
| 	group = 'diagnostics', | -- 	group = 'diagnostics', | ||||||
| 	callback = function() | -- 	callback = function() | ||||||
| 		vim.diagnostic.setloclist { open = false } | -- 		vim.diagnostic.setloclist { open = false } | ||||||
| 	end, | -- 	end, | ||||||
| }) | -- }) | ||||||
| 
 | 
 | ||||||
| -- resize splits if window got resized | -- resize splits if window got resized | ||||||
| vim.api.nvim_create_autocmd({ 'VimResized' }, { | vim.api.nvim_create_autocmd({ 'VimResized' }, { | ||||||
| @ -73,3 +73,12 @@ vim.cmd [[ | |||||||
|         au ExitPre * :set guicursor=a:hor90 |         au ExitPre * :set guicursor=a:hor90 | ||||||
|     augroup END |     augroup END | ||||||
| ]] | ]] | ||||||
|  | 
 | ||||||
|  | function _G.set_terminal_keymaps() | ||||||
|  | 	local opts = { buffer = 0 } | ||||||
|  | 	vim.keymap.set('t', '<esc>', [[<C-\><C-n>]], opts) | ||||||
|  | 	vim.keymap.set('t', '<C-w>', [[<C-\><C-n><C-w>]], opts) | ||||||
|  | end | ||||||
|  | 
 | ||||||
|  | -- if you only want these mappings for toggle term use term://*toggleterm#* instead | ||||||
|  | vim.cmd('autocmd! TermOpen term://* lua set_terminal_keymaps()') | ||||||
|  | |||||||
| @ -1,5 +1,8 @@ | |||||||
| local opt = { noremap = true, silent = true } | local opt = { noremap = true, silent = true } | ||||||
| local keymap = vim.api.nvim_set_keymap | local keymap = vim.api.nvim_set_keymap | ||||||
|  | 
 | ||||||
|  | keymap('n', '<c-,>', '<cmd>silent! NeoSwapPrev<cr>', opt) | ||||||
|  | keymap('n', '<c-.>', '<cmd>silent! NeoSwapNext<cr>', opt) | ||||||
| -- TODO: Remove this | -- TODO: Remove this | ||||||
| keymap('n', '<insert>', '<cmd>Lazy profile<cr>', opt) | keymap('n', '<insert>', '<cmd>Lazy profile<cr>', opt) | ||||||
| -- resize {{{ | -- resize {{{ | ||||||
| @ -11,6 +14,19 @@ keymap('n', '<c-right>', '<cmd>vertical resize -2<cr>', opt) | |||||||
| -- indent {{{ | -- indent {{{ | ||||||
| keymap('v', '<', '<gv', opt) | keymap('v', '<', '<gv', opt) | ||||||
| keymap('v', '>', '>gv', opt) | keymap('v', '>', '>gv', opt) | ||||||
|  | vim.cmd([[ | ||||||
|  | nnoremap <c-j> :m .+1<CR>== | ||||||
|  | nnoremap <c-k> :m .-2<CR>== | ||||||
|  | inoremap <c-j> <Esc>:m .+1<CR>==gi | ||||||
|  | inoremap <c-k> <Esc>:m .-2<CR>==gi | ||||||
|  | vnoremap <c-j> :m '>+1<CR>gv=gv | ||||||
|  | vnoremap <c-k> :m '<-2<CR>gv=gv | ||||||
|  | ]]) | ||||||
|  | 
 | ||||||
|  | keymap('n', 'Y', '"+y', opt) | ||||||
|  | keymap('v', 'Y', '"+y', opt) | ||||||
|  | keymap('n', '<c-p>', '"+p', opt) | ||||||
|  | keymap('v', '<c-p>', '"+p', opt) | ||||||
| -- }}} | -- }}} | ||||||
| -- open/close folds with enter key {{{ | -- open/close folds with enter key {{{ | ||||||
| keymap('n', '<cr>', "@=(foldlevel('.')?'za':\"<Space>\")<CR>", opt) | keymap('n', '<cr>', "@=(foldlevel('.')?'za':\"<Space>\")<CR>", opt) | ||||||
| @ -25,6 +41,23 @@ keymap('t', '<end>', '<cmd>ToggleTerm direction=float<cr>', opt) | |||||||
| keymap('v', '<end>', '<cmd>ToggleTerm direction=float<cr>', opt) | keymap('v', '<end>', '<cmd>ToggleTerm direction=float<cr>', opt) | ||||||
| keymap('i', '<end>', '<cmd>ToggleTerm direction=float<cr>', opt) | keymap('i', '<end>', '<cmd>ToggleTerm direction=float<cr>', opt) | ||||||
| -- }}} | -- }}} | ||||||
|  | -- trouble {{{ | ||||||
|  | vim.api.nvim_set_keymap('n', '<leader>xl', '<cmd>TroubleToggle loclist<cr>', { silent = true, noremap = true }) | ||||||
|  | vim.api.nvim_set_keymap('n', '<leader>xq', '<cmd>TroubleToggle quickfix<cr>', { silent = true, noremap = true }) | ||||||
|  | vim.api.nvim_set_keymap('n', '<leader>xx', '<cmd>TroubleToggle<cr>', { silent = true, noremap = true }) | ||||||
|  | vim.api.nvim_set_keymap( | ||||||
|  | 	'n', | ||||||
|  | 	'<leader>xw', | ||||||
|  | 	'<cmd>TroubleToggle workspace_diagnostics<cr>', | ||||||
|  | 	{ silent = true, noremap = true } | ||||||
|  | ) | ||||||
|  | vim.api.nvim_set_keymap( | ||||||
|  | 	'n', | ||||||
|  | 	'<leader>xd', | ||||||
|  | 	'<cmd>TroubleToggle document_diagnostics<cr>', | ||||||
|  | 	{ silent = true, noremap = true } | ||||||
|  | ) | ||||||
|  | -- }}} | ||||||
| 
 | 
 | ||||||
| keymap('n', '<BS>', ':', { noremap = true }) | keymap('n', '<BS>', ':', { noremap = true }) | ||||||
| keymap('n', ';', ':', { noremap = true }) | keymap('n', ';', ':', { noremap = true }) | ||||||
| @ -251,6 +284,12 @@ local mappings = { | |||||||
| 		v = { '<C-w>v', 'Vertical split' }, | 		v = { '<C-w>v', 'Vertical split' }, | ||||||
| 		h = { '<C-w>s', 'Horizontal split' }, | 		h = { '<C-w>s', 'Horizontal split' }, | ||||||
| 	}, | 	}, | ||||||
|  | 	['o'] = { | ||||||
|  | 		name = 'Neorg', | ||||||
|  | 		i = { '<cmd>Neorg index<cr>', 'Index' }, | ||||||
|  | 		n = { '<cmd>Neorg workspace notes<cr>', 'Notes' }, | ||||||
|  | 		t = { '<cmd>Neorg workspace todo<cr>', 'Todo' }, | ||||||
|  | 	} | ||||||
| } | } | ||||||
| -- }}} | -- }}} | ||||||
| wk.register(mappings, opts) | wk.register(mappings, opts) | ||||||
|  | |||||||
| @ -4,6 +4,14 @@ local opt = vim.opt | |||||||
| g.mapleader = ' ' | g.mapleader = ' ' | ||||||
| g.tex_flavor = 'latex' | g.tex_flavor = 'latex' | ||||||
| g.c_syntax_for_h = true | g.c_syntax_for_h = true | ||||||
|  | vim.cmd([[ | ||||||
|  | let g:VM_leader                     = {'default': ',', 'visual': ',', 'buffer': ','} | ||||||
|  | let g:VM_maps                       = {} | ||||||
|  | let g:VM_custom_motions             = {'n': 'j', 'l': 'i', 'e': 'k', 'i': 'l'} | ||||||
|  | let g:VM_maps['i']                  = 'l' | ||||||
|  | let g:VM_maps['I']                  = 'L' | ||||||
|  | let g:VM_mouse_mappings             = 1 | ||||||
|  | ]]) | ||||||
| 
 | 
 | ||||||
| opt.termguicolors = true | opt.termguicolors = true | ||||||
| opt.mouse = 'nv' | opt.mouse = 'nv' | ||||||
| @ -14,7 +22,7 @@ opt.showmode = false | |||||||
| opt.undofile = true | opt.undofile = true | ||||||
| opt.updatetime = 300 | opt.updatetime = 300 | ||||||
| opt.backup = false | opt.backup = false | ||||||
| opt.clipboard:prepend { 'unnamedplus' } | opt.clipboard:prepend { 'unnamedplus', 'unnamed' } | ||||||
| opt.ignorecase = true | opt.ignorecase = true | ||||||
| opt.smartcase = true | opt.smartcase = true | ||||||
| opt.sessionoptions = 'folds' | opt.sessionoptions = 'folds' | ||||||
| @ -24,7 +32,7 @@ opt.shortmess:append('I', 'W', 's') | |||||||
| opt.iskeyword:prepend { '-' } | opt.iskeyword:prepend { '-' } | ||||||
| opt.timeoutlen = 300 | opt.timeoutlen = 300 | ||||||
| opt.fillchars = 'eob: ' | opt.fillchars = 'eob: ' | ||||||
| opt.cmdheight = 0 | opt.cmdheight = 1 | ||||||
| opt.grepprg = 'rg --vimgrep --no-heading --smart-case --hidden' | opt.grepprg = 'rg --vimgrep --no-heading --smart-case --hidden' | ||||||
| opt.grepformat = '%f:%l:%c:%m' | opt.grepformat = '%f:%l:%c:%m' | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -1,45 +1,31 @@ | |||||||
| return { | return { | ||||||
| 	{ |  | ||||||
| 		'stevearc/dressing.nvim', |  | ||||||
| 		opts = {}, |  | ||||||
| 		-- lazy = false, |  | ||||||
| 	}, |  | ||||||
| 	'MunifTanjim/nui.nvim', | 	'MunifTanjim/nui.nvim', | ||||||
| 	'folke/which-key.nvim', | 	'folke/which-key.nvim', | ||||||
| 	'nvim-lua/plenary.nvim', | 	'nvim-lua/plenary.nvim', | ||||||
| 	--	'mfussenegger/nvim-jdtls', | 	--	'mfussenegger/nvim-jdtls', | ||||||
| 	'simrat39/rust-tools.nvim', | 	'simrat39/rust-tools.nvim', | ||||||
|  | 	{ 'mg979/vim-visual-multi',  event = 'VeryLazy' }, | ||||||
| 	{ 'rush-rs/tree-sitter-asm', ft = 'asm' }, | 	{ 'rush-rs/tree-sitter-asm', ft = 'asm' }, | ||||||
| 	{ 'jghauser/mkdir.nvim',     lazy = false }, | 	{ | ||||||
|  | 		'gennaro-tedesco/nvim-peekup', | ||||||
|  | 		config = function() | ||||||
|  | 			local c = require 'nvim-peekup.config' | ||||||
|  | 			c.on_keystroke['delay'] = '' | ||||||
|  | 			c.on_keystroke['paste_reg'] = '+' | ||||||
|  | 		end | ||||||
|  | 	}, | ||||||
|  | 	{ 'jghauser/mkdir.nvim', lazy = false }, | ||||||
|  | 	{ | ||||||
|  | 		'stevearc/dressing.nvim', | ||||||
|  | 		opts = {}, | ||||||
|  | 		-- lazy = false, | ||||||
|  | 	}, | ||||||
| 	{ | 	{ | ||||||
| 		url = 'https://git.filnar.com/fiplox/neogruber.git', | 		url = 'https://git.filnar.com/fiplox/neogruber.git', | ||||||
| 		-- dir = '~/dev/neogruber.nvim/', | 		-- dir = '~/dev/neogruber.nvim/', | ||||||
| 		lazy = false, | 		lazy = false, | ||||||
| 		-- event = 'VeryLazy' | 		-- event = 'VeryLazy' | ||||||
| 	}, | 	}, | ||||||
| 	{ |  | ||||||
| 		'folke/flash.nvim', |  | ||||||
| 		-- event = 'VeryLazy', |  | ||||||
| 		---@type Flash.Config |  | ||||||
| 		opts = {}, |  | ||||||
| 		keys = { |  | ||||||
| 			{ |  | ||||||
| 				's', |  | ||||||
| 				mode = { 'n', 'x', 'o' }, |  | ||||||
| 				function() |  | ||||||
| 					-- default options: exact mode, multi window, all directions, with a backdrop |  | ||||||
| 					require('flash').jump() |  | ||||||
| 				end, |  | ||||||
| 			}, |  | ||||||
| 			{ |  | ||||||
| 				'S', |  | ||||||
| 				mode = { 'o', 'x' }, |  | ||||||
| 				function() |  | ||||||
| 					require('flash').treesitter() |  | ||||||
| 				end, |  | ||||||
| 			}, |  | ||||||
| 		}, |  | ||||||
| 	}, |  | ||||||
| 	{ | 	{ | ||||||
| 		'numToStr/Comment.nvim', | 		'numToStr/Comment.nvim', | ||||||
| 		-- event = 'VeryLazy', | 		-- event = 'VeryLazy', | ||||||
| @ -316,7 +302,7 @@ return { | |||||||
| 				-- context_commentstring = { enable = true, config = { css = '// %s' } }, | 				-- context_commentstring = { enable = true, config = { css = '// %s' } }, | ||||||
| 				-- indent = {enable = true, disable = {"python", "html", "javascript"}}, | 				-- indent = {enable = true, disable = {"python", "html", "javascript"}}, | ||||||
| 				-- TODO seems to be broken | 				-- TODO seems to be broken | ||||||
| 				indent = { enable = false, disable = { 'python', 'css' } }, | 				indent = { enable = true, disable = { 'python', 'css' } }, | ||||||
| 				-- autotag = { enable = true }, | 				-- autotag = { enable = true }, | ||||||
| 			} | 			} | ||||||
| 		end, | 		end, | ||||||
| @ -369,4 +355,8 @@ return { | |||||||
| 			} | 			} | ||||||
| 		end, | 		end, | ||||||
| 	}, | 	}, | ||||||
|  | 	{ | ||||||
|  | 		"ecthelionvi/NeoSwap.nvim", | ||||||
|  | 		opts = {} | ||||||
|  | 	}, | ||||||
| } | } | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user