diff options
author | Brahmajit Das <brahmajit.xyz@gmail.com> | 2024-03-09 22:06:39 +0530 |
---|---|---|
committer | Brahmajit Das <brahmajit.xyz@gmail.com> | 2024-03-09 22:06:39 +0530 |
commit | 8da47a6335f4662f12a191db101b28d143659f3a (patch) | |
tree | db7c962aa957a9014adf886c067940a153a5ed2f | |
parent | f44fd24bb87f2bc615d81dc40017fcdca3462a76 (diff) |
deleting old config files
Signed-off-by: Brahmajit Das <brahmajit.xyz@gmail.com>
-rw-r--r-- | after/ftplugin/mail.vim | 5 | ||||
-rw-r--r-- | after/ftplugin/man.lua | 10 | ||||
-rw-r--r-- | after/ftplugin/markdown.vim | 22 | ||||
-rw-r--r-- | after/ftplugin/python.vim | 9 | ||||
-rw-r--r-- | after/ftplugin/tex.vim | 11 | ||||
-rw-r--r-- | init.lua | 57 | ||||
-rw-r--r-- | lua/core/appearance.lua | 52 | ||||
-rw-r--r-- | lua/core/colorscheme.lua | 3 | ||||
-rw-r--r-- | lua/core/keymaps.lua | 46 | ||||
-rw-r--r-- | lua/core/options.lua | 90 | ||||
-rw-r--r-- | lua/core/settings.lua | 21 | ||||
-rw-r--r-- | lua/core/utils.lua | 17 | ||||
-rw-r--r-- | lua/plugins/autopairs.lua | 17 | ||||
-rw-r--r-- | lua/plugins/cmp.lua | 148 | ||||
-rw-r--r-- | lua/plugins/gitsigns.lua | 40 | ||||
-rw-r--r-- | lua/plugins/lsp-config.lua | 107 | ||||
-rw-r--r-- | lua/plugins/lualine.lua | 40 | ||||
-rw-r--r-- | lua/plugins/nvim-tree.lua | 34 | ||||
-rw-r--r-- | lua/plugins/plugins.lua | 92 | ||||
-rw-r--r-- | lua/plugins/treesitter.lua | 32 | ||||
-rw-r--r-- | lua/plugins/usnippet.lua | 5 | ||||
-rw-r--r-- | lua/plugins/vimtex.lua | 27 |
22 files changed, 0 insertions, 885 deletions
diff --git a/after/ftplugin/mail.vim b/after/ftplugin/mail.vim deleted file mode 100644 index 1f7f8bd..0000000 --- a/after/ftplugin/mail.vim +++ /dev/null @@ -1,5 +0,0 @@ -autocmd BufRead,BufNewFile *mutt-* setfiletype mail -au BufRead /tmp/*mutt-* set tw=72 -set textwidth=72 -set colorcolumn=72 -set spell diff --git a/after/ftplugin/man.lua b/after/ftplugin/man.lua deleted file mode 100644 index e50e3d2..0000000 --- a/after/ftplugin/man.lua +++ /dev/null @@ -1,10 +0,0 @@ -vim.opt_local.number = false -vim.opt_local.relativenumber = false -vim.opt_local.signcolumn = 'no' -vim.opt_local.scrolloff = 999 - -vim.keymap.set({ 'n', 'x' }, 'q', 'ZQ', { buffer = true, nowait = true }) -vim.keymap.set({ 'n', 'x' }, 'd', '<C-d>', { buffer = true, nowait = true }) -vim.keymap.set({ 'n', 'x' }, 'u', '<C-u>', { buffer = true, nowait = true }) - -vim.cmd('normal! M') diff --git a/after/ftplugin/markdown.vim b/after/ftplugin/markdown.vim deleted file mode 100644 index 1306802..0000000 --- a/after/ftplugin/markdown.vim +++ /dev/null @@ -1,22 +0,0 @@ -" Table mode -let b:table_mode_corner='|' -let b:table_mode_corner_corner='|' -let b:table_mode_header_fillchar='-' -let g:table_mode_align_char=':' - -let g:vim_markdown_folding_disabled=1 -let g:vim_markdown_conceal=0 -let g:vim_markdown_anchorexpr="'<<'.v:anchor.'>>'" - -" Spell checking -set spell spelllang=en_us -set textwidth=72 -set colorcolumn=72 - -" Does not highlight conceal -highlight Conceal ctermbg=NONE ctermfg=NONE guibg=NONE guifg=NONE - -" Make `gf` create new files if not exists -map gf :e <cfile><CR> - -let java_ignore_javadoc=1 diff --git a/after/ftplugin/python.vim b/after/ftplugin/python.vim deleted file mode 100644 index 2da6441..0000000 --- a/after/ftplugin/python.vim +++ /dev/null @@ -1,9 +0,0 @@ -" signcolumn -setlocal signcolumn=yes - -" tabs and spaces -set tabstop=8 expandtab shiftwidth=4 softtabstop=4 -filetype indent on - -" character limit -setlocal textwidth=80 diff --git a/after/ftplugin/tex.vim b/after/ftplugin/tex.vim deleted file mode 100644 index ed179bc..0000000 --- a/after/ftplugin/tex.vim +++ /dev/null @@ -1,11 +0,0 @@ -" Does not highlight conceal -highlight Conceal ctermbg=NONE ctermfg=NONE guibg=NONE guifg=NONE -let g:vimtex_view_general_viewer = 'zathura' - -" VimTex specific settings -set conceallevel=1 -let g:tex_conceal='abdmg' - -" Spell checking -set spell spelllang=en_us -set textwidth=80 diff --git a/init.lua b/init.lua deleted file mode 100644 index fbf21e5..0000000 --- a/init.lua +++ /dev/null @@ -1,57 +0,0 @@ --- Neovim init file -if vim.fn.executable('nvr') == 0 then - vim.api.nvim_command('!pip3 install --user --break-system-packages neovim-remote') -end - --- Import Lua modules -require('plugins.plugins') -require('plugins.cmp') -require('plugins.lsp-config') -require('plugins.usnippet') -require('plugins.lualine') -require('plugins.treesitter') -require('plugins.vimtex') -require('plugins.nvim-tree') -require('plugins.gitsigns') -require('plugins.autopairs') -require('core.appearance') -require('core.options') -require('core.utils') -require('core.settings') -require('core.keymaps') -require('core.colorscheme') - -require'colorizer'.setup() - --- Setup language servers. -local lspconfig = require('lspconfig') -lspconfig.clangd.setup{ - on_attach = require("plugins.lsp-config").on_attach, - cpabilities = require("plugins.lsp-config").cpabilities, - lsp_flags = require("plugins.lsp-config").lsp_flags, -} -lspconfig.lua_ls.setup { - on_attach = require("plugins.lsp-config").on_attach, - cpabilities = require("plugins.lsp-config").cpabilities, - lsp_flags = require("plugins.lsp-config").lsp_flags, - settings = { - Lua = { - runtime = { - -- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim) - version = 'LuaJIT', - }, - diagnostics = { - -- Get the language server to recognize the `vim` global - globals = {'vim'}, - }, - workspace = { - -- Make the server aware of Neovim runtime files - library = vim.api.nvim_get_runtime_file("", true), - }, - -- Do not send telemetry data containing a randomized but unique identifier - telemetry = { - enable = false, - }, - }, - }, -} diff --git a/lua/core/appearance.lua b/lua/core/appearance.lua deleted file mode 100644 index ba73502..0000000 --- a/lua/core/appearance.lua +++ /dev/null @@ -1,52 +0,0 @@ -local opt = vim.opt -- Set options (global/buffer/windows-scoped) - ------------------------------------------------------------ --- Neovim UI ------------------------------------------------------------ -opt.number = true -- Show line number -opt.relativenumber = true -- Show relative line number -opt.showmatch = true -- Highlight matching parenthesis -opt.foldmethod = 'marker' -- Enable folding (default 'foldmarker') -opt.splitright = true -- Vertical split to the right -opt.splitbelow = true -- Horizontal split to the bottom -opt.ignorecase = true -- Ignore case letters when search -opt.smartcase = true -- Ignore lowercase for the whole pattern -opt.linebreak = true -- Wrap on word boundary -opt.termguicolors = true -- Enable 24-bit RGB colors -opt.laststatus = 2 -- Set global statusline -opt.splitbelow = true -opt.splitright = true -opt.scrolloff = 2 -opt.sidescrolloff = 5 -opt.foldlevelstart = 99 -opt.ruler = false -opt.list = true -opt.showtabline = 0 -opt.winwidth = 30 -opt.winminwidth = 10 -opt.pumheight = 15 -opt.helpheight = 12 -opt.previewheight = 12 -opt.showcmd = false -opt.listchars = 'tab:░ ,extends:›,precedes:‹,nbsp:·,trail:·' -opt.background = 'dark' -opt.cmdheight = 2 -opt.fillchars = { - diff = "╱", - vert = "│", - fold = "⠀", - eob = " ", -- suppress ~ at EndOfBuffer - --diff = "⣿", -- alternatives = ⣿ ░ ─ ╱ - msgsep = "‾", - foldopen = "▾", - foldsep = "│", - foldclose = "▸", -} - -vim.cmd [[ - " Function, identifier and comments in italic - highlight Function cterm=italic gui=italic - highlight Indentifier cterm=none gui=italic - highlight Comment cterm=italic gui=italic -]] -vim.cmd[[ "syntax sync fromstart" ]] diff --git a/lua/core/colorscheme.lua b/lua/core/colorscheme.lua deleted file mode 100644 index 5402f11..0000000 --- a/lua/core/colorscheme.lua +++ /dev/null @@ -1,3 +0,0 @@ --- Default options: --- vim.cmd.colorscheme "oxocarbon" -vim.cmd("colorscheme kanagawa-dragon") diff --git a/lua/core/keymaps.lua b/lua/core/keymaps.lua deleted file mode 100644 index 1305224..0000000 --- a/lua/core/keymaps.lua +++ /dev/null @@ -1,46 +0,0 @@ ------------------------------------------------------------ --- Define keymaps of Neovim and installed plugins. ------------------------------------------------------------ - -local function map(mode, lhs, rhs, opts) - local options = { noremap = true, silent = true } - if opts then - options = vim.tbl_extend('force', options, opts) - end - vim.api.nvim_set_keymap(mode, lhs, rhs, options) -end - --- Change leader to a comma -vim.g.mapleader = ',' - ------------------------------------------------------------ --- Neovim shortcuts ------------------------------------------------------------ - --- Disable arrow keys -map('', '<up>', '<nop>') -map('', '<down>', '<nop>') -map('', '<left>', '<nop>') -map('', '<right>', '<nop>') - --- Reload configuration without restart nvim -map('n', '<leader>r', ':so %<CR>') - --- Change split orientation -map('n', '<leader>tk', '<C-w>t<C-w>K') -- change vertical to horizontal -map('n', '<leader>th', '<C-w>t<C-w>H') -- change horizontal to vertical - -map('n', 'M-j', ':resize -2<CR>') -map('n', 'M-k', ':resize +2<CR>') -map('n', 'M-l', ':vertical resize -2<CR>') -map('n', 'M-h', ':vertical resize +2<CR>') - -map('t', 'C-w', '<C-\\><C-n><C-w>') - -map('n', '<leader>B', ':Buffers<CR>') -- FZF show open buffers -map('n', '<leader>F', ':Files<CR>') -- FZF show files -map('n', '<leader>A', ':Rg<CR>') -- FZF call ripgrep -map('n', '<leader>C', ':Commits<CR>') -- FZF show git commits -map('n', '<leader>M', ':Maps<CR>') -- FZF show normal mode mappings - -map('n', '<leader>e', ':NvimTreeToggle<CR>') diff --git a/lua/core/options.lua b/lua/core/options.lua deleted file mode 100644 index 5a53b42..0000000 --- a/lua/core/options.lua +++ /dev/null @@ -1,90 +0,0 @@ ------------------------------------------------------------ --- General Neovim settings and configuration ------------------------------------------------------------ - -local g = vim.g -- Global variables -local opt = vim.opt -- Set options (global/buffer/windows-scoped) -local cache_dir = os.getenv('HOME') .. '/.cache/nvim/' - ------------------------------------------------------------ --- General ------------------------------------------------------------ -opt.mouse = 'a' -- Enable mouse support -opt.clipboard = 'unnamedplus' -- Copy/paste to system clipboard -opt.swapfile = false -- Don't use swapfile -opt.completeopt = 'menuone,noinsert,noselect' -- Autocomplete options -opt.history = 500 -- Lines vim should remember -opt.backup = false -opt.writebackup = false -opt.shell = 'zsh' -opt.magic = true -- Vim's regular expression magic -opt.mat = 2 -- How many tenths of seconds ro blink -opt.fileformats = 'unix,mac,dos' -- Unix as standard file format -opt.encoding = 'utf-8' -- Encoding -opt.viewoptions = 'folds,cursor,curdir,slash,unix' -opt.wildignorecase = true -opt.wildignore = '.git,.hg,.svn,*.pyc,*.o,*.out,*.jpg,*.jpeg,*.png,*.gif,*.zip,*.DS_Store,**/node_modules/**,**/bower_modules/**' -opt.hlsearch = false -- No highlight search -opt.incsearch = true -opt.ignorecase = true -opt.backspace = 'indent,eol,start' -opt.exrc = true - ------------------------------------------------------------ --- Tabs, indent ------------------------------------------------------------ -opt.shiftwidth = 4 -- Shift 4 spaces when tab -opt.tabstop = 4 -- 1 tab == 4 spaces -opt.softtabstop = 4 -- 1 tab == 4 spaces -opt.expandtab = false -- Use spaces instead of tabs -opt.smartindent = true -- Autoindent new lines -opt.autoindent = true -- Copy indent from current line when starting new line -opt.cindent = true -- C programming indentation - ------------------------------------------------------------ --- Memory, CPU ------------------------------------------------------------ -opt.hidden = true -- Enable background buffers -opt.lazyredraw = true -- Faster scrolling -opt.synmaxcol = 240 -- Max column for syntax highlight -opt.updatetime = 300 -- ms to wait for trigger an event -opt.timeoutlen = 500 -- ms to wait for a mapped sequence to complete. -opt.foldenable = false - ------------------------------------------------------------ --- Startup ------------------------------------------------------------ --- Disable nvim intro -opt.shortmess:append "csI" - --- -- Disable builtin plugins -local disabled_built_ins = { - "2html_plugin", - "getscript", - "getscriptPlugin", - "gzip", - "logipat", - "netrw", - "netrwPlugin", - "netrwSettings", - "netrwFileHandlers", - "matchit", - "tar", - "tarPlugin", - "rrhelper", - "spellfile_plugin", - "vimball", - "vimballPlugin", - "zip", - "zipPlugin", - "tutor", - "rplugin", - "synmenu", - "optwin", - "compiler", - "bugreport", -} - -for _, plugin in pairs(disabled_built_ins) do - g["loaded_" .. plugin] = 1 -end diff --git a/lua/core/settings.lua b/lua/core/settings.lua deleted file mode 100644 index 6d0b3c5..0000000 --- a/lua/core/settings.lua +++ /dev/null @@ -1,21 +0,0 @@ --- --- Mainly filetype settings --- - -local cmd = vim.cmd -local u = require('core/utils') - -u.create_augroup({ - { 'BufRead,BufNewFile', '/tmp/nail-*', 'setlocal', 'ft=mail' }, - { 'BufRead,BufNewFile', '*s-nail-*', 'setlocal', 'ft=mail' }, - { 'BufRead,BufNewFile', '*mutt-*', 'setlocal', 'ft=mail' }, - { 'BufRead', '/tmp/*mutt-*', 'setlocal', 'tw=72' }, -}, 'ftmail') - --- Autoremove unwanted whitespaces -cmd [[ - au BufRead,BufNewFile *mutt-* setfiletype mail -]] - --- Add in the following like to auto remove empty lines --- au BufWritePre * %s/\s\+$//e diff --git a/lua/core/utils.lua b/lua/core/utils.lua deleted file mode 100644 index 7c8a7bf..0000000 --- a/lua/core/utils.lua +++ /dev/null @@ -1,17 +0,0 @@ --- --- Auto group utilites --- - -local M = {} -local cmd = vim.cmd - -function M.create_augroup(autocmds, name) - cmd('augroup ' .. name) - cmd('autocmd!') - for _, autocmd in ipairs(autocmds) do - cmd('autocmd ' .. table.concat(autocmd, ' ')) - end - cmd('augroup END') -end - -return M diff --git a/lua/plugins/autopairs.lua b/lua/plugins/autopairs.lua deleted file mode 100644 index 340bdea..0000000 --- a/lua/plugins/autopairs.lua +++ /dev/null @@ -1,17 +0,0 @@ -local disable_filetype = { "TelescopePrompt", "spectre_panel" } -local disable_in_macro = false -- disable when recording or executing a macro -local disable_in_visualblock = false -- disable when insert after visual block mode -local disable_in_replace_mode = true -local ignored_next_char = [=[[%w%%%'%[%"%.%`%$]]=] -local enable_moveright = true -local enable_afterquote = true -- add bracket pairs after quote -local enable_check_bracket_line = true --- check bracket in same line -local enable_bracket_in_quote = true -- -local enable_abbr = false -- trigger abbreviation -local break_undo = true -- switch for basic rule break undo sequence -local check_ts = false -local map_cr = true -local map_bs = true -- map the <BS> key -local map_c_h = false -- Map the <C-h> key to delete a pair -local map_c_w = false -- map <c-w> to delete a pair if possible -require('nvim-autopairs').setup() diff --git a/lua/plugins/cmp.lua b/lua/plugins/cmp.lua deleted file mode 100644 index b5a302d..0000000 --- a/lua/plugins/cmp.lua +++ /dev/null @@ -1,148 +0,0 @@ -local has_words_before = function() - local line, col = unpack(vim.api.nvim_win_get_cursor(0)) - return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil -end - --- luasnip setup -local luasnip = require 'luasnip' - -local kind_icons = { - Text = "", - Method = "", - Function = "", - Constructor = "", - Field = "", - Variable = "", - Class = "", - Interface = "", - Module = "", - Property = "", - Unit = "", - Value = "", - Enum = "", - Keyword = "", - Snippet = "", - Color = "", - File = "", - Reference = "", - Folder = "", - EnumMember = "", - Constant = "", - Struct = "", - Event = "", - Operator = "", - TypeParameter = "", -} - --- nvim-cmp setup -local cmp = require('cmp') -cmp.setup { - formatting = { - format = function(entry, vim_item) - local label = vim_item.abbr - local truncated_label = vim.fn.strcharpart(label, 0, 50) - if truncated_label ~= label then - vim_item.abbr = truncated_label .. '...' - end - vim_item.kind = string.format('%s %s', kind_icons[vim_item.kind], vim_item.kind) - vim_item.menu = ({ - buffer = "[Buffer]", - nvim_lsp = "[LSP]", - luasnip = "[LuaSnip]", - nvim_lua = "[Lua]", - latex_symbols = "[LaTeX]", - })[entry.source.name] - return vim_item - end - }, - snippet = { - expand = function(args) - require('luasnip').lsp_expand(args.body) -- For `luasnip` users. - end, - }, - window = { - completion = cmp.config.window.bordered(), - documentation = cmp.config.window.bordered(), - }, - mapping = cmp.mapping.preset.insert({ - ['<C-d>'] = cmp.mapping.scroll_docs(-4), - ['<C-f>'] = cmp.mapping.scroll_docs(4), - ['<C-Space>'] = cmp.mapping.complete(), - ['<CR>'] = cmp.mapping.confirm { - behavior = cmp.ConfirmBehavior.Insert, - select = true, - }, - ['<Tab>'] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_next_item() - elseif luasnip.expand_or_jumpable() then - luasnip.expand_or_jump() - elseif has_words_before() then - cmp.complete() - else - fallback() - end - end, { "i", "s" }), - ['<S-Tab>'] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_prev_item() - elseif luasnip.jumpable(-1) then - luasnip.jump(-1) - else - fallback() - end - end, { 'i', 's' }), - }), - sources = cmp.config.sources({ - { name = 'luasnip', option = { use_show_condition = false } }, - { name = 'nvim_lsp' }, - { name = 'nvim_lsp_signature_help' }, - { name = 'path' }, - { name = 'buffer' }, - { name = 'nvim_lua' }, - }), -} --- Set configuration for specific filetype. -cmp.setup.filetype('gitcommit', { - sources = cmp.config.sources({ - { name = 'git' }, -- You can specify the `cmp_git` source if you were installed it. - { name = 'buffer' }, - }), - require("cmp_git").setup(), -}) - --- Use buffer source for `/` (if you enabled `native_menu`, this won't work anymore). -require'cmp'.setup.cmdline('/', { - completion = { autocomplete = false }, - sources = { - -- { name = 'buffer' } - { name = 'buffer', opts = { keyword_pattern = [=[[^[:blank:]].*]=] } } - } -}) - --- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore). -cmp.setup.cmdline(':', { - completion = { autocomplete = false }, - sources = cmp.config.sources({ - { name = 'path' } - }, { - { name = 'cmdline' } - }) -}) - --- If you want insert `(` after select function or method item -local cmp_autopairs = require('nvim-autopairs.completion.cmp') -local cmp = require('cmp') -cmp.event:on( -'confirm_done', -cmp_autopairs.on_confirm_done() -) - --- lazy loading to get in memory snippets of languages you use -require("luasnip/loaders/from_vscode").lazy_load() -local keymap = vim.api.nvim_set_keymap -local opts = { noremap = true, silent = true } -keymap("i", "<c-j>", "<cmd>lua require'luasnip'.jump(1)<CR>", opts) -keymap("s", "<c-j>", "<cmd>lua require'luasnip'.jump(1)<CR>", opts) -keymap("i", "<c-k>", "<cmd>lua require'luasnip'.jump(-1)<CR>", opts) -keymap("s", "<c-k>", "<cmd>lua require'luasnip'.jump(-1)<CR>", opts) diff --git a/lua/plugins/gitsigns.lua b/lua/plugins/gitsigns.lua deleted file mode 100644 index 1d8c1eb..0000000 --- a/lua/plugins/gitsigns.lua +++ /dev/null @@ -1,40 +0,0 @@ -require('gitsigns').setup{ - on_attach = function(bufnr) - local gs = package.loaded.gitsigns - - local function map(mode, l, r, opts) - opts = opts or {} - opts.buffer = bufnr - vim.keymap.set(mode, l, r, opts) - end - - -- Navigation - map('n', ']c', function() - if vim.wo.diff then return ']c' end - vim.schedule(function() gs.next_hunk() end) - return '<Ignore>' - end, {expr=true}) - - map('n', '[c', function() - if vim.wo.diff then return '[c' end - vim.schedule(function() gs.prev_hunk() end) - return '<Ignore>' - end, {expr=true}) - - -- Actions - map({'n', 'v'}, '<leader>hs', ':Gitsigns stage_hunk<CR>') - map({'n', 'v'}, '<leader>hr', ':Gitsigns reset_hunk<CR>') - map('n', '<leader>hS', gs.stage_buffer) - map('n', '<leader>hu', gs.undo_stage_hunk) - map('n', '<leader>hR', gs.reset_buffer) - map('n', '<leader>hp', gs.preview_hunk) - map('n', '<leader>hb', function() gs.blame_line{full=true} end) - map('n', '<leader>tb', gs.toggle_current_line_blame) - map('n', '<leader>hd', gs.diffthis) - map('n', '<leader>hD', function() gs.diffthis('~') end) - map('n', '<leader>td', gs.toggle_deleted) - - -- Text object - map({'o', 'x'}, 'ih', ':<C-U>Gitsigns select_hunk<CR>') - end -} diff --git a/lua/plugins/lsp-config.lua b/lua/plugins/lsp-config.lua deleted file mode 100644 index 2494443..0000000 --- a/lua/plugins/lsp-config.lua +++ /dev/null @@ -1,107 +0,0 @@ --- Add additional capabilities supported by nvim-cmp -local M = {} - -vim.diagnostic.config({ - virtual_text = false, - signs = true, - underline = false, - update_in_insert = true, - severity_sort = false, - float = { - source = "always", - }, -}) - - -local signs = { Error = " ", Warn = " ", Hint = " ", Info = " " } -for type, icon in pairs(signs) do - local hl = "DiagnosticSign" .. type - vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = hl }) -end - -vim.o.updatetime = 250 -vim.cmd [[autocmd! CursorHold,CursorHoldI * lua vim.diagnostic.open_float(nil, {focus=false, scope="cursor"})]] ---vim.cmd [[autocmd! CursorHold,CursorHoldI * lua vim.diagnostic.open_float(nil, {focus=false})]] ---vim.cmd [[autocmd! ColorScheme * highlight NormalFloat guibg=#4c4f69]] ---vim.cmd [[autocmd! ColorScheme * highlight FloatBorder guifg=white guibg=#1f2335]] - -local border = { - {"🭽", "FloatBorder"}, - {"▔", "FloatBorder"}, - {"🭾", "FloatBorder"}, - {"▕", "FloatBorder"}, - {"🭿", "FloatBorder"}, - {"▁", "FloatBorder"}, - {"🭼", "FloatBorder"}, - {"▏", "FloatBorder"}, -} - --- To instead override globally -local orig_util_open_floating_preview = vim.lsp.util.open_floating_preview -function vim.lsp.util.open_floating_preview(contents, syntax, opts, ...) - opts = opts or {} - opts.border = opts.border or border - return orig_util_open_floating_preview(contents, syntax, opts, ...) -end - -local capabilities = vim.lsp.protocol.make_client_capabilities() -M.capabilities = require('cmp_nvim_lsp').default_capabilities(capabilities) - -local lspconfig = require('lspconfig') - ---vim.lsp.set_log_level(vim.log.levels.DEBUG) - --- Use an on_attach function to only map the following keys --- after the language server attaches to the current buffer -M.on_attach = function(client, bufnr) - -- Mappings. - -- See `:help vim.lsp.*` for documentation on any of the below functions - local bufopts = { noremap=true, silent=true, buffer=bufnr } - vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, bufopts) - vim.keymap.set('n', 'gd', vim.lsp.buf.definition, bufopts) - vim.keymap.set('n', 'K', vim.lsp.buf.hover, bufopts) - vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, bufopts) - vim.keymap.set('n', '<C-k>', vim.lsp.buf.signature_help, bufopts) - vim.keymap.set('n', '<space>wa', vim.lsp.buf.add_workspace_folder, bufopts) - vim.keymap.set('n', '<space>wr', vim.lsp.buf.remove_workspace_folder, bufopts) - vim.keymap.set('n', '<space>wl', function() - print(vim.inspect(vim.lsp.buf.list_workspace_folders())) - end, bufopts) - vim.keymap.set('n', '<leader>D', vim.lsp.buf.type_definition, bufopts) - vim.keymap.set('n', '<leader>rn', vim.lsp.buf.rename, bufopts) - vim.keymap.set('n', '<leader>ca', vim.lsp.buf.code_action, bufopts) - vim.keymap.set('n', 'gr', vim.lsp.buf.references, bufopts) - vim.keymap.set('n', '<leader>f', function() vim.lsp.buf.format { async = true } end, bufopts) - - -- See `:help vim.diagnostic.*` for documentation on any of the below functions - local opts = { noremap=true, silent=true } - vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, opts) - vim.keymap.set('n', ']d', vim.diagnostic.goto_next, opts) - vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist, opts) - - vim.api.nvim_create_autocmd("CursorHold", { - buffer = bufnr, - callback = function() - local opts = { - focusable = false, - close_events = { "BufLeave", "CursorMoved", "InsertEnter", "FocusLost" }, - border = 'rounded', - source = 'always', - prefix = ' ', - scope = 'cursor', - } - vim.diagnostic.open_float(nil, opts) - end - }) -end - ---- In .nvim.lua of your project paste in this ---- ---- require'lspconfig'.clangd.setup{ ---- on_attach = require("plugins.lsp-config").on_attach, ---- cpabilities = require("plugins.lsp-config").cpabilities, ---- lsp_flags = require("plugins.lsp-config").lsp_flags, ---- cmd = {vim.fn.expand('~/esp/esp-clang/bin/clangd')} ---- } ---- -return M diff --git a/lua/plugins/lualine.lua b/lua/plugins/lualine.lua deleted file mode 100644 index 9797e9e..0000000 --- a/lua/plugins/lualine.lua +++ /dev/null @@ -1,40 +0,0 @@ -require('lualine').setup { - options = { - icons_enabled = true, - theme = 'auto', - component_separators = { left = '', right = ''}, - section_separators = { left = '', right = ''}, - disabled_filetypes = { - statusline = {}, - winbar = {}, - }, - ignore_focus = {}, - always_divide_middle = true, - globalstatus = false, - refresh = { - statusline = 1000, - tabline = 1000, - winbar = 1000, - } - }, - sections = { - lualine_a = {'mode'}, - lualine_b = {'branch', 'diff', 'diagnostics'}, - lualine_c = {'filename'}, - lualine_x = {'encoding', 'fileformat', 'filetype'}, - lualine_y = {'progress'}, - lualine_z = {'location'} - }, - inactive_sections = { - lualine_a = {}, - lualine_b = {}, - lualine_c = {'filename'}, - lualine_x = {'location'}, - lualine_y = {}, - lualine_z = {} - }, - tabline = {}, - winbar = {}, - inactive_winbar = {}, - extensions = {} -} diff --git a/lua/plugins/nvim-tree.lua b/lua/plugins/nvim-tree.lua deleted file mode 100644 index 061ae9e..0000000 --- a/lua/plugins/nvim-tree.lua +++ /dev/null @@ -1,34 +0,0 @@ --- disable netrw at the very start of your init.lua (strongly advised) -vim.g.loaded_netrw = 1 -vim.g.loaded_netrwPlugin = 1 - --- OR setup with some options -require('nvim-tree').setup({ - sort_by = "case_sensitive", - on_attach = "disable", - view = { - centralize_selection = false, - cursorline = true, - debounce_delay = 15, - width = 34, - side = "left", - preserve_window_proportions = false, - number = false, - relativenumber = false, - signcolumn = "yes", - }, - renderer = { - group_empty = true, - highlight_opened_files = "all" - }, - filters = { - dotfiles = true, - }, - git = { - enable = true, - ignore = true, - show_on_dirs = true, - show_on_open_dirs = true, - timeout = 400, - }, -}) diff --git a/lua/plugins/plugins.lua b/lua/plugins/plugins.lua deleted file mode 100644 index 4a340d0..0000000 --- a/lua/plugins/plugins.lua +++ /dev/null @@ -1,92 +0,0 @@ --- Automatically install packer -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 - packer_bootstrap = fn.system({ - 'git', - 'clone', - '--depth', - '1', - 'https://github.com/wbthomason/packer.nvim', - install_path - }) - vim.o.runtimepath = vim.fn.stdpath('data') .. '/site/pack/*/start/*,' .. vim.o.runtimepath -end - --- Autocommand that reloads neovim whenever you save the packer_init.lua file -vim.cmd [[ -augroup packer_user_config -autocmd! -autocmd BufWritePost packer_init.lua source <afile> | PackerSync -augroup end -]] - --- Use a protected call so we don't error out on first use -local status_ok, packer = pcall(require, 'packer') -if not status_ok then - return -end - --- Only required if you have packer configured as `opt` -return packer.startup(function(use) - -- Packer can manage itself - use 'wbthomason/packer.nvim' - - -- Color scheme - use {'nyoom-engineering/oxocarbon.nvim'} - use {'rebelot/kanagawa.nvim'} - - -- File tree - use 'nvim-tree/nvim-tree.lua' - - -- Completion and language server - use {'neovim/nvim-lspconfig'} -- Collection of configurations for built-in LSP client - use {'hrsh7th/cmp-nvim-lsp'} -- LSP source for nvim-cmp - use {'hrsh7th/cmp-buffer'} -- LSP source nvim-cmp - use {'hrsh7th/cmp-path'} -- LSP source for nvim-cmp - use {'hrsh7th/cmp-cmdline'} -- LSP source nvim-cmp - use {'hrsh7th/cmp-nvim-lsp-signature-help'} - use {'hrsh7th/nvim-cmp'} -- Autocompletion plugin - use {'hrsh7th/cmp-nvim-lua'} - use {'saadparwaiz1/cmp_luasnip'} -- Snippets source for nvim-cmp - use {'L3MON4D3/LuaSnip'} -- Snippets plugin - use {"rafamadriz/friendly-snippets"} - use({"petertriho/cmp-git", requires = "nvim-lua/plenary.nvim"}) - - -- Show color under hex codes - use {'norcalli/nvim-colorizer.lua'} - - -- Productivity plugins - use {'windwp/nvim-autopairs'} -- Auto pairs - use {'preservim/nerdcommenter'} -- Easy commenting - use {'dhruvasagar/vim-table-mode', ft = {'markdown', 'markdown.pandoc'} } -- Markdown easy tables - use {'junegunn/fzf', run = ":call fzf#install()" } - use {'junegunn/fzf.vim' } -- Fuzzy file finding - use {'tpope/vim-surround'} -- Easy surrounding with brackets, quotes ... - use {'junegunn/vim-easy-align'} -- Easy aling with space, = ... - - -- Writing - use {'junegunn/goyo.vim', ft = {'markdown', 'markdown.pandoc', 'tex', 'c'}} - use {'junegunn/limelight.vim', ft = {'markdown', 'markdown.pandoc', 'tex', 'c'}} - - use { 'vim-pandoc/vim-pandoc-syntax', ft = { 'markdown', 'markdown.pandoc' } } - use { 'lervag/vimtex', ft = { 'tex' } } - - -- Git intigration - use { 'tpope/vim-fugitive', ft = {'cpp', 'c'} } - - -- Treesitter integration - use { 'nvim-treesitter/nvim-treesitter', run = ':TSUpdate' } - - -- Show git signs and stage hunks - use { 'lewis6991/gitsigns.nvim' } - - use { 'nvim-lualine/lualine.nvim' } - - -- Automatically set up your configuration after cloning packer.nvim - -- Put this at the end after all plugins - if packer_bootstrap then - require('packer').sync() - end -end) diff --git a/lua/plugins/treesitter.lua b/lua/plugins/treesitter.lua deleted file mode 100644 index 03c3038..0000000 --- a/lua/plugins/treesitter.lua +++ /dev/null @@ -1,32 +0,0 @@ -require'nvim-treesitter.configs'.setup { - -- A list of parser names, or "all" - ensure_installed = { "c", "lua", "cpp" }, - - -- Install parsers synchronously (only applied to `ensure_installed`) - sync_install = true, - - -- Automatically install missing parsers when entering buffer - auto_install = false, - - -- List of parsers to ignore installing (for "all") - ignore_install = { "javascript" }, - - highlight = { - -- `false` will disable the whole extension - enable = true, - - -- NOTE: these are the names of the parsers and not the filetype. (for example if you want to - -- disable highlighting for the `tex` filetype, you need to include `latex` in this list as this is - -- the name of the parser) - -- list of language that will be disabled - -- disable = { "c", "rust" }, - - -- 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, - }, - - indent = true, -} diff --git a/lua/plugins/usnippet.lua b/lua/plugins/usnippet.lua deleted file mode 100644 index 431169d..0000000 --- a/lua/plugins/usnippet.lua +++ /dev/null @@ -1,5 +0,0 @@ -vim.g.UltiSnipsExpandTrigger = "<c-tab>" -vim.g.UltiSnipsJumpForwardTrigger = "<nop>" -vim.g.UltiSnipsJumpBackwardTrigger = "<nop>" - -vim.g.UltiSnipsSnippetDirectories = { 'UltiSnips', 'my_snippets' } diff --git a/lua/plugins/vimtex.lua b/lua/plugins/vimtex.lua deleted file mode 100644 index 646ecbe..0000000 --- a/lua/plugins/vimtex.lua +++ /dev/null @@ -1,27 +0,0 @@ -vim.g.vimtex_view_method = "zathura" -vim.g.vimtex_view_general_viewer = "zathura" -vim.g.vimtex_view_forward_search_on_start = false -vim.g.vimtex_toc_config = { - mode = 1, - fold_enable = 0, - hide_line_numbers = 1, - resize = 0, - refresh_always = 1, - show_help = 0, - show_numbers = 1, - split_pos = 'leftabove', - split_width = 30, - tocdeth = 3, - indent_levels = 1, - todo_sorted = 1, -} --- vim.g.vimtex_latexmk_options = "-shell-escape -verbose -file-line-error -synctex=1 -interaction=nonstopmode" --- vim.g.vimtex_compiler_latexmk = "lualatex" --- vim.cmd([[ syntax enable ]]) --- vim.g.vimtex_compiler_latexmk_engines = { --- _ = '-lualatex', --- pdflatex = '-pdf', --- dvipdfex = '-pdfdvi', --- lualatex = '-lualatex', --- xelatex = '-xelatex' --- } |