Compare commits
	
		
			No commits in common. "04f768affc55e07862705e04caecf6f97cb016fd" and "1aedb8a4741005c1d80a531b698915e43e43db09" have entirely different histories.
		
	
	
		
			04f768affc
			...
			1aedb8a474
		
	
		
							
								
								
									
										3
									
								
								init.lua
									
									
									
									
									
								
							
							
						
						
									
										3
									
								
								init.lua
									
									
									
									
									
								
							@ -18,12 +18,11 @@ vim.api.nvim_create_autocmd('User', {
 | 
			
		||||
	callback = function()
 | 
			
		||||
		vim.cmd 'colorscheme neogruber'
 | 
			
		||||
		require 'feline'
 | 
			
		||||
		require 'flash'
 | 
			
		||||
		require 'config.mappings'
 | 
			
		||||
		require 'config.autocmd'
 | 
			
		||||
		require 'nvim-treesitter'
 | 
			
		||||
		require 'dressing'
 | 
			
		||||
		require 'NeoSwap'
 | 
			
		||||
		require 'nvim-peekup'
 | 
			
		||||
	end,
 | 
			
		||||
})
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -10,8 +10,8 @@ vim.api.nvim_create_autocmd({ 'FileType' }, {
 | 
			
		||||
	pattern = { 'qf', 'help', 'man', 'lspinfo', 'spectre_panel', 'lir' },
 | 
			
		||||
	callback = function()
 | 
			
		||||
		vim.cmd [[
 | 
			
		||||
      nnoremap <silent> <buffer> q :close<CR>
 | 
			
		||||
      set nobuflisted
 | 
			
		||||
      nnoremap <silent> <buffer> q :close<CR> 
 | 
			
		||||
      set nobuflisted 
 | 
			
		||||
    ]]
 | 
			
		||||
	end,
 | 
			
		||||
})
 | 
			
		||||
@ -40,14 +40,14 @@ vim.api.nvim_create_autocmd({ 'TextYankPost' }, {
 | 
			
		||||
	end,
 | 
			
		||||
})
 | 
			
		||||
 | 
			
		||||
-- vim.api.nvim_create_augroup('diagnostics', { clear = true })
 | 
			
		||||
--
 | 
			
		||||
-- vim.api.nvim_create_autocmd({ 'DiagnosticChanged' }, {
 | 
			
		||||
-- 	group = 'diagnostics',
 | 
			
		||||
-- 	callback = function()
 | 
			
		||||
-- 		vim.diagnostic.setloclist { open = false }
 | 
			
		||||
-- 	end,
 | 
			
		||||
-- })
 | 
			
		||||
vim.api.nvim_create_augroup('diagnostics', { clear = true })
 | 
			
		||||
 | 
			
		||||
vim.api.nvim_create_autocmd({ 'DiagnosticChanged' }, {
 | 
			
		||||
	group = 'diagnostics',
 | 
			
		||||
	callback = function()
 | 
			
		||||
		vim.diagnostic.setloclist { open = false }
 | 
			
		||||
	end,
 | 
			
		||||
})
 | 
			
		||||
 | 
			
		||||
-- resize splits if window got resized
 | 
			
		||||
vim.api.nvim_create_autocmd({ 'VimResized' }, {
 | 
			
		||||
@ -73,12 +73,3 @@ vim.cmd [[
 | 
			
		||||
        au ExitPre * :set guicursor=a:hor90
 | 
			
		||||
    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,8 +1,5 @@
 | 
			
		||||
local opt = { noremap = true, silent = true }
 | 
			
		||||
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
 | 
			
		||||
keymap('n', '<insert>', '<cmd>Lazy profile<cr>', opt)
 | 
			
		||||
-- resize {{{
 | 
			
		||||
@ -14,19 +11,6 @@ keymap('n', '<c-right>', '<cmd>vertical resize -2<cr>', opt)
 | 
			
		||||
-- indent {{{
 | 
			
		||||
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 {{{
 | 
			
		||||
keymap('n', '<cr>', "@=(foldlevel('.')?'za':\"<Space>\")<CR>", opt)
 | 
			
		||||
@ -41,23 +25,6 @@ keymap('t', '<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)
 | 
			
		||||
-- }}}
 | 
			
		||||
-- 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', ';', ':', { noremap = true })
 | 
			
		||||
@ -284,12 +251,6 @@ local mappings = {
 | 
			
		||||
		v = { '<C-w>v', 'Vertical 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)
 | 
			
		||||
 | 
			
		||||
@ -4,14 +4,6 @@ local opt = vim.opt
 | 
			
		||||
g.mapleader = ' '
 | 
			
		||||
g.tex_flavor = 'latex'
 | 
			
		||||
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.mouse = 'nv'
 | 
			
		||||
@ -22,7 +14,7 @@ opt.showmode = false
 | 
			
		||||
opt.undofile = true
 | 
			
		||||
opt.updatetime = 300
 | 
			
		||||
opt.backup = false
 | 
			
		||||
opt.clipboard:prepend { 'unnamedplus', 'unnamed' }
 | 
			
		||||
opt.clipboard:prepend { 'unnamedplus' }
 | 
			
		||||
opt.ignorecase = true
 | 
			
		||||
opt.smartcase = true
 | 
			
		||||
opt.sessionoptions = 'folds'
 | 
			
		||||
@ -32,7 +24,7 @@ opt.shortmess:append('I', 'W', 's')
 | 
			
		||||
opt.iskeyword:prepend { '-' }
 | 
			
		||||
opt.timeoutlen = 300
 | 
			
		||||
opt.fillchars = 'eob: '
 | 
			
		||||
opt.cmdheight = 1
 | 
			
		||||
opt.cmdheight = 0
 | 
			
		||||
opt.grepprg = 'rg --vimgrep --no-heading --smart-case --hidden'
 | 
			
		||||
opt.grepformat = '%f:%l:%c:%m'
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -32,13 +32,12 @@ end
 | 
			
		||||
end ]=]
 | 
			
		||||
 | 
			
		||||
M.lsp_config = {
 | 
			
		||||
	-- virtual_text = {
 | 
			
		||||
	-- 	prefix = '●',
 | 
			
		||||
	-- },
 | 
			
		||||
	virtual_text = false,
 | 
			
		||||
	virtual_text = {
 | 
			
		||||
		prefix = '●',
 | 
			
		||||
	},
 | 
			
		||||
	signs = false,
 | 
			
		||||
	underline = true,
 | 
			
		||||
	update_in_insert = false,
 | 
			
		||||
	update_in_insert = true,
 | 
			
		||||
	severity_sort = false,
 | 
			
		||||
	float = {
 | 
			
		||||
		focusable = false,
 | 
			
		||||
 | 
			
		||||
@ -28,8 +28,8 @@ return {
 | 
			
		||||
				},
 | 
			
		||||
			},
 | 
			
		||||
			completion = {
 | 
			
		||||
				-- autocomplete = { 'TextChanged', 'CmdlineChanged', 'TextChangedP' },
 | 
			
		||||
				autocomplete = false,
 | 
			
		||||
				autocomplete = { 'TextChanged', 'CmdlineChanged', 'TextChangedP' },
 | 
			
		||||
				-- autocomplete = false,
 | 
			
		||||
			},
 | 
			
		||||
			snippet = {
 | 
			
		||||
				expand = function(args)
 | 
			
		||||
@ -94,8 +94,8 @@ return {
 | 
			
		||||
			sources = {
 | 
			
		||||
				{ name = 'nvim_lsp' },
 | 
			
		||||
				{ name = 'neorg' },
 | 
			
		||||
				{ name = 'path' },
 | 
			
		||||
				{ name = 'snippy' },
 | 
			
		||||
				{ name = 'path' },
 | 
			
		||||
				{ name = 'buffer' },
 | 
			
		||||
			},
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
@ -1,31 +1,45 @@
 | 
			
		||||
return {
 | 
			
		||||
	'MunifTanjim/nui.nvim',
 | 
			
		||||
	'folke/which-key.nvim',
 | 
			
		||||
	'nvim-lua/plenary.nvim',
 | 
			
		||||
	--	'mfussenegger/nvim-jdtls',
 | 
			
		||||
	'simrat39/rust-tools.nvim',
 | 
			
		||||
	{ 'mg979/vim-visual-multi',  event = 'VeryLazy' },
 | 
			
		||||
	{ 'rush-rs/tree-sitter-asm', ft = 'asm' },
 | 
			
		||||
	{
 | 
			
		||||
		'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,
 | 
			
		||||
	},
 | 
			
		||||
	'MunifTanjim/nui.nvim',
 | 
			
		||||
	'folke/which-key.nvim',
 | 
			
		||||
	'nvim-lua/plenary.nvim',
 | 
			
		||||
	--	'mfussenegger/nvim-jdtls',
 | 
			
		||||
	'simrat39/rust-tools.nvim',
 | 
			
		||||
	{ 'rush-rs/tree-sitter-asm', ft = 'asm' },
 | 
			
		||||
	{ 'jghauser/mkdir.nvim',     lazy = false },
 | 
			
		||||
	{
 | 
			
		||||
		url = 'https://git.filnar.com/fiplox/neogruber.git',
 | 
			
		||||
		-- dir = '~/dev/neogruber.nvim/',
 | 
			
		||||
		lazy = false,
 | 
			
		||||
		-- 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',
 | 
			
		||||
		-- event = 'VeryLazy',
 | 
			
		||||
@ -302,7 +316,7 @@ return {
 | 
			
		||||
				-- context_commentstring = { enable = true, config = { css = '// %s' } },
 | 
			
		||||
				-- indent = {enable = true, disable = {"python", "html", "javascript"}},
 | 
			
		||||
				-- TODO seems to be broken
 | 
			
		||||
				indent = { enable = true, disable = { 'python', 'css' } },
 | 
			
		||||
				indent = { enable = false, disable = { 'python', 'css' } },
 | 
			
		||||
				-- autotag = { enable = true },
 | 
			
		||||
			}
 | 
			
		||||
		end,
 | 
			
		||||
@ -355,8 +369,4 @@ return {
 | 
			
		||||
			}
 | 
			
		||||
		end,
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		"ecthelionvi/NeoSwap.nvim",
 | 
			
		||||
		opts = {}
 | 
			
		||||
	},
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -7,7 +7,7 @@ local M = {
 | 
			
		||||
	dependencies = { 'hrsh7th/cmp-nvim-lsp', 'williamboman/mason.nvim' },
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
local servers = { 'clangd', 'rust_analyzer', 'lua_ls', 'pyright', 'gopls', 'jdtls', 'asm_lsp', 'texlab', 'elixirls' }
 | 
			
		||||
local servers = { 'clangd', 'rust_analyzer', 'lua_ls', 'pyright', 'gopls', 'jdtls', 'asm_lsp', 'texlab' }
 | 
			
		||||
 | 
			
		||||
local function on_attach(client, bufnr)
 | 
			
		||||
	--[[ vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc') ]]
 | 
			
		||||
@ -113,12 +113,6 @@ function M.config()
 | 
			
		||||
			}
 | 
			
		||||
			goto continue
 | 
			
		||||
		end
 | 
			
		||||
		if server == 'elixirls' then
 | 
			
		||||
			local elixir_opts = {
 | 
			
		||||
				cmd = { "/home/user/.local/share/nvim/mason/packages/elixir-ls/language_server.sh" },
 | 
			
		||||
			}
 | 
			
		||||
			opts = vim.tbl_deep_extend('force', elixir_opts, opts)
 | 
			
		||||
		end
 | 
			
		||||
		lspconfig[server].setup(opts)
 | 
			
		||||
		::continue::
 | 
			
		||||
	end
 | 
			
		||||
 | 
			
		||||
@ -33,14 +33,14 @@ return {
 | 
			
		||||
			open_folds = { "zR", "zr" }, -- open all folds
 | 
			
		||||
			toggle_fold = { "zA", "za" }, -- toggle fold of current file
 | 
			
		||||
			previous = "k", -- previous item
 | 
			
		||||
			next = "j"   -- next item
 | 
			
		||||
			next = "j" -- next item
 | 
			
		||||
		},
 | 
			
		||||
		indent_lines = true, -- add an indent guide below the fold icons
 | 
			
		||||
		auto_open = false,   -- automatically open the list when you have diagnostics
 | 
			
		||||
		auto_close = true,   -- automatically close the list when you have no diagnostics
 | 
			
		||||
		auto_open = false, -- automatically open the list when you have diagnostics
 | 
			
		||||
		auto_close = true, -- automatically close the list when you have no diagnostics
 | 
			
		||||
		auto_preview = false, -- automatically preview the location of the diagnostic. <esc> to close preview and go back to last window
 | 
			
		||||
		auto_fold = false,   -- automatically fold a file trouble list at creation
 | 
			
		||||
		auto_jump = { "lsp_definitions" }, -- for the given modes, automatically jump if there is only a single result
 | 
			
		||||
		auto_fold = false, -- automatically fold a file trouble list at creation
 | 
			
		||||
		auto_jump = {},  -- for the given modes, automatically jump if there is only a single result
 | 
			
		||||
		signs = {
 | 
			
		||||
			-- icons / text used for a diagnostic
 | 
			
		||||
			error = "",
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user