diff --git a/.config/nvim/after/plugin/colors.lua b/.config/nvim/after/plugin/colors.lua new file mode 100644 index 00000000..5a577bc9 --- /dev/null +++ b/.config/nvim/after/plugin/colors.lua @@ -0,0 +1,5 @@ +vim.g.tokyonight_transparent_sidebar = true +vim.g.tokyonight_transparent = true +vim.opt.background = "dark" + +vim.cmd("colorscheme tokyonight") diff --git a/.config/nvim/after/plugin/init.lua b/.config/nvim/after/plugin/init.lua new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/.config/nvim/after/plugin/init.lua @@ -0,0 +1 @@ + diff --git a/.config/nvim/after/plugin/lsp.lua b/.config/nvim/after/plugin/lsp.lua new file mode 100644 index 00000000..6fdab072 --- /dev/null +++ b/.config/nvim/after/plugin/lsp.lua @@ -0,0 +1,219 @@ +local Remap = require("rahcodes.keymap") +local nnoremap = Remap.nnoremap +local inoremap = Remap.inoremap + +local sumneko_root_path = "/usr/lib/lua-language-server" +local sumneko_binary = "/usr/bin/lua-language-server" + +-- Setup nvim-cmp. +local cmp = require("cmp") +local source_mapping = { + youtube = "[Suck it YT]", + buffer = "[Buffer]", + nvim_lsp = "[LSP]", + nvim_lua = "[Lua]", + -- cmp_tabnine = "[TN]", + path = "[Path]", +} +local lspkind = require("lspkind") + +cmp.setup({ + snippet = { + expand = function(args) + -- For `vsnip` user. + -- vim.fn["vsnip#anonymous"](args.body) + + -- For `luasnip` user. + require("luasnip").lsp_expand(args.body) + + -- For `ultisnips` user. + -- vim.fn["UltiSnips#Anon"](args.body) + end, + }, + mapping = cmp.mapping.preset.insert({ + [""] = cmp.mapping.scroll_docs(-4), + [""] = cmp.mapping.scroll_docs(4), + [""] = cmp.mapping.complete(), + [''] = cmp.mapping.confirm({ select = true }), + }), + + formatting = { + format = function(entry, vim_item) + vim_item.kind = lspkind.presets.default[vim_item.kind] + local menu = source_mapping[entry.source.name] +-- if entry.source.name == "cmp_tabnine" then +-- if entry.completion_item.data ~= nil and entry.completion_item.data.detail ~= nil then +-- menu = entry.completion_item.data.detail .. " " .. menu +-- end +-- vim_item.kind = "" +-- end + vim_item.menu = menu + return vim_item + end, + }, + + sources = { + -- tabnine completion? yayaya + -- { name = "cmp_tabnine" }, + + { name = "nvim_lsp" }, + + -- For vsnip user. + -- { name = 'vsnip' }, + + -- For luasnip user. + { name = "luasnip" }, + + -- For ultisnips user. + -- { name = 'ultisnips' }, + + { name = "buffer" }, + + { name = "youtube" }, + }, +}) + +--[[ +local tabnine = require("cmp_tabnine.config") +tabnine:setup({ + max_lines = 1000, + max_num_results = 20, + sort = true, + run_on_every_keystroke = true, + snippet_placeholder = "..", +}) +]]-- + +local function config(_config) + return vim.tbl_deep_extend("force", { + on_attach = function() + nnoremap("gD", function() vim.lsp.buf.definition() end) + nnoremap("gd", function() vim.lsp.buf.definition() end) + nnoremap("K", function() vim.lsp.buf.hover() end) + nnoremap("gi", function() vim.lsp.buf.implementation() end) + nnoremap("wa", function() vim.lsp.buf.add_workspace_folder() end) + nnoremap("wr", function() vim.lsp.buf.remove_workspace_folder() end) + nnoremap("wl", function() print(vim.inspect(vim.lsp.buf.list_workspace_folders())) end) + nnoremap("vws", function() vim.lsp.buf.workspace_symbol() end) + nnoremap("vd", function() vim.diagnostic.open_float() end) + nnoremap("[d", function() vim.diagnostic.goto_next() end) + nnoremap("]d", function() vim.diagnostic.goto_prev() end) + nnoremap("ca", function() vim.lsp.buf.code_action() end) + nnoremap("vco", function() vim.lsp.buf.code_action({ + filter = function(code_action) + if not code_action or not code_action.data then + return false + end + + local data = code_action.data.id + return string.sub(data, #data - 1, #data) == ":0" + end, + apply = true + }) end) + nnoremap("gr", function() vim.lsp.buf.references() end) + nnoremap("rn", function() vim.lsp.buf.rename() end) + inoremap("", function() vim.lsp.buf.signature_help() end) + nnoremap("f", function() vim.lsp.buf.format({ async = true }) end) + end, + }, _config or {}) +end + +require("lspconfig").zls.setup(config()) + +require("lspconfig").tsserver.setup(config()) + +require("lspconfig").ccls.setup(config()) + +require("lspconfig").jedi_language_server.setup(config()) + +require("lspconfig").svelte.setup(config()) + +require("lspconfig").solang.setup(config()) + +require("lspconfig").cssls.setup(config()) + +require("lspconfig").gopls.setup(config({ + cmd = { "gopls", "serve" }, + settings = { + gopls = { + analyses = { + unusedparams = true, + }, + staticcheck = true, + }, + }, +})) + +-- who even uses this? +require("lspconfig").rust_analyzer.setup(config({ + cmd = { "rustup", "run", "nightly", "rust-analyzer" }, + --[[ + settings = { + rust = { + unstable_features = true, + build_on_save = false, + all_features = true, + }, + } + --]] +})) + +require("lspconfig").sumneko_lua.setup(config({ + cmd = { sumneko_binary, "-E", sumneko_root_path .. "/main.lua" }, + settings = { + Lua = { + runtime = { + -- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim) + version = "LuaJIT", + -- Setup your lua path + path = vim.split(package.path, ";"), + }, + diagnostics = { + -- Get the language server to recognize the `vim` global + globals = { "vim" }, + }, + workspace = { + -- Make the server aware of Neovim runtime files + library = { + [vim.fn.expand("$VIMRUNTIME/lua")] = true, + [vim.fn.expand("$VIMRUNTIME/lua/vim/lsp")] = true, + }, + }, + }, + }, +})) + +local opts = { + -- whether to highlight the currently hovered symbol + -- disable if your cpu usage is higher than you want it + -- or you just hate the highlight + -- default: true + highlight_hovered_item = true, + + -- whether to show outline guides + -- default: true + show_guides = true, +} + +require("symbols-outline").setup(opts) + +local snippets_paths = function() + local plugins = { "friendly-snippets" } + local paths = {} + local path + local root_path = vim.env.HOME .. "/.vim/plugged/" + for _, plug in ipairs(plugins) do + path = root_path .. plug + if vim.fn.isdirectory(path) ~= 0 then + table.insert(paths, path) + end + end + return paths +end + +require("luasnip.loaders.from_vscode").lazy_load({ + paths = snippets_paths(), + include = nil, -- Load all languages + exclude = {}, +}) + diff --git a/.config/nvim/after/plugin/lualine.lua b/.config/nvim/after/plugin/lualine.lua new file mode 100644 index 00000000..d873f970 --- /dev/null +++ b/.config/nvim/after/plugin/lualine.lua @@ -0,0 +1,7 @@ +require('lualine').setup({ + options = { + icons_enabled = true, + } +}) + + diff --git a/.config/nvim/after/plugin/mason.lua b/.config/nvim/after/plugin/mason.lua new file mode 100644 index 00000000..87b303c3 --- /dev/null +++ b/.config/nvim/after/plugin/mason.lua @@ -0,0 +1,33 @@ +local mason_status, mason = pcall(require, "mason") +if not mason_status then + return +end + +local mason_lspconfig_status, mason_lspconfig = pcall(require, "mason-lspconfig") +if not mason_lspconfig_status then + return +end + +local mason_null_ls_status, mason_null_ls = pcall(require, "mason-null-ls") +if not mason_null_ls_status then + return +end + +mason.setup() + +mason_lspconfig.setup({ + ensure_installed = { + "tsserver", + "html", + "cssls", + "sumneko_lua", + } +}) + +mason_null_ls.setup({ + ensure_installed = { + "prettier", + "stylua", + "eslint_d", + } +}) diff --git a/.config/nvim/after/plugin/null-ls.lua b/.config/nvim/after/plugin/null-ls.lua new file mode 100644 index 00000000..268d3f1f --- /dev/null +++ b/.config/nvim/after/plugin/null-ls.lua @@ -0,0 +1,31 @@ +local setup, null_ls = pcall(require, "null-ls") +if not setup then + return +end + +local formatting = null_ls.builtins.formatting +local diagnostics = null_ls.builtins.diagnostics +local augroup = vim.api.nvim_create_augroup("LspFormatting", {}) + +null_ls.setup({ + sources = { + formatting.prettier, + formatting.stylua, + diagnostics.eslint_d + }, + -- format on save + on_attach = function(client, bufnr) + if client.supports_method("textDocument/formatting") then + vim.api.nvim_clear_autocmds({ group = augroup, buffer = bufnr }) + vim.api.nvim_create_autocmd("BufWritePre", { + group = augroup, + buffer = bufnr, + callback = function() + -- on 0.8, you should use vim.lsp.buf.format({ bufnr = bufnr }) instead + vim.lsp.buf.format({ bufnr = bufnr }) + end, + }) + end + end, +}) + diff --git a/.config/nvim/after/plugin/treesitter.lua b/.config/nvim/after/plugin/treesitter.lua new file mode 100644 index 00000000..d8ffff57 --- /dev/null +++ b/.config/nvim/after/plugin/treesitter.lua @@ -0,0 +1,36 @@ +require("nvim-treesitter.configs").setup({ + -- A list of parser names, or "all" + ensure_installed = { "ruby", "typescript", "javascript", "lua", "rust" }, + + -- Install parsers synchronously (only applied to `ensure_installed`) + sync_install = false, + + -- Automatically install missing parsers when entering buffer + -- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally + auto_install = true, + + ---- If you need to change the installation directory of the parsers (see -> Advanced Setup) + -- parser_install_dir = "/some/path/to/store/parsers", -- Remember to run vim.opt.runtimepath:append("/some/path/to/store/parsers")! + + indent = { enable = true }, + + highlight = { + -- `false` will disable the whole extension + enable = true, + + -- Or use a function for more flexibility, e.g. to disable slow treesitter highlight for large files + disable = function(_, buf) + local max_filesize = 100 * 1024 -- 100 KB + local ok, stats = pcall(vim.loop.fs_stat, vim.api.nvim_buf_get_name(buf)) + if ok and stats and stats.size > max_filesize then + return true + end + end, + + -- 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, + }, +}) diff --git a/.config/nvim/coc-settings.json b/.config/nvim/coc-settings.json deleted file mode 100644 index 642de05e..00000000 --- a/.config/nvim/coc-settings.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "coc.preferences.formatOnSaveFiletypes": [ - "css", - "markdown", - "javascript", - "typescript", - "typescriptreact", - "go", - "ruby" - ], - "eslint.autoFixOnSave": true, - "diagnostic.checkCurrentLine": true, - "codeLens.enabled": true, - "solargraph.autoformat": true, - "solargraph.formatting": true, - "solargraph.hover": true, - "solargraph.diagnostics": true, - "solargraph.checkGemVersion": false -} diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua new file mode 100644 index 00000000..88935737 --- /dev/null +++ b/.config/nvim/init.lua @@ -0,0 +1 @@ +require('rahcodes') diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim deleted file mode 100644 index a9803e0d..00000000 --- a/.config/nvim/init.vim +++ /dev/null @@ -1,132 +0,0 @@ -let mapleader = " " -vnoremap J :m '>+1gv=gv -vnoremap K :m '<-2gv=gv - -nnoremap / /\v -vnoremap / /\v -nnoremap / :Rg -vnoremap / :Rg -nnoremap ` :noh - -" No Cheating -nnoremap -nnoremap -nnoremap -nnoremap -inoremap -inoremap -inoremap -inoremap - -" No weird line jumps -nnoremap j gj -nnoremap k gk - -" FZF Bindings -noremap :GFiles -noremap pf :Files -nnoremap C :Colors -nnoremap B :Buffers -nnoremap fl :Lines -noremap m :History -noremap / :Rg - -" Use fuzzy completion relative filepaths across directory -imap fzf#vim#complete#path('git ls-files $(git rev-parse --show-toplevel)') - -" Better command history with q: -command! CmdHist call fzf#vim#command_history({'right': '40'}) -nnoremap q: :CmdHist - -" Better search history -command! QHist call fzf#vim#search_history({'right': '40'}) -nnoremap q/ :QHist - -command! -bang -nargs=* Ack call fzf#vim#ag(, {'down': '40%', 'options': --no-color'}) - -inoremap -nnoremap -vnoremap - -inoremap hh - -" - Avoid using standard Vim directory names like 'plugin' -call plug#begin() - -Plug 'gruvbox-community/gruvbox' -Plug 'tpope/vim-repeat' -Plug 'tpope/vim-surround' -Plug 'tpope/vim-fugitive' -Plug 'vim-airline/vim-airline' -Plug 'vim-airline/vim-airline-themes' -Plug 'junegunn/fzf', { 'do': { -> fzf#install() } } -Plug 'junegunn/fzf.vim' -Plug 'stsewd/fzf-checkout.vim' -Plug 'leafgarland/typescript-vim' -Plug 'airblade/vim-gitgutter' -Plug 'neoclide/coc.nvim', {'branch': 'release'} -Plug 'tpope/vim-rhubarb' -Plug 'thesis/vim-solidity' -Plug 'vim-test/vim-test' - -" Initialize plugin system -call plug#end() - -syntax on -let g:gruvbox_contrast_dark = 'hard' -let g:gruvbox_italic=1 -let g:gruvbox_invert_selection='0' -set termguicolors -set background=dark - -augroup RAH_CODES - autocmd! - autocmd vimenter * ++nested colorscheme gruvbox -augroup END - -"let g:netrw_banner = 0 -"let g:netrw_liststyle = 3 -"let g:netrw_browse_split = 4 -"let g:netrw_altv = 1 -"let g:netrw_winsize = 25 -"augroup ProjectDrawer -" autocmd! -" autocmd VimEnter * :Vexplore -"augroup END -nnoremap pv :Vex - -let g:airline_powerline_fonts = 1 -let g:airline#extensions#tGabline#enabled = 1 - -" Completion -set completeopt=menuone,noinsert,noselect -let g:completion_matching_strategy_list = ['exact', 'substring', 'fuzzy'] - -" Git Fugitive -nnoremap gs :G -nnoremap gh :diffget //3 -nnoremap gu :diffget //2 -nnoremap gc :GCheckout -nnoremap ga :G add %:p -nnoremap gc :G commit -v -q -nnoremap gt :G commit -v -q %:p -nnoremap gca :G commit --amend --no-edit -nnoremap gd :Gdiff -nnoremap ge :Gedit -nnoremap gr :Gread -nnoremap gw :Gwrite -nnoremap gl :silent! Glog:bot copen -nnoremap gp :Ggrep -nnoremap gm :Gmove -nnoremap gb :G branch -nnoremap go :G checkout -nnoremap gps :Dispatch! git push -nnoremap gpl :Dispatch! git pull - -" Copy to system clipboard -vnoremap y "*y -vnoremap yy "+y - -" Move buffers -nmap sp :bprev -nmap sn :bnext diff --git a/.config/nvim/lua/rahcodes/init.lua b/.config/nvim/lua/rahcodes/init.lua new file mode 100644 index 00000000..2466e67b --- /dev/null +++ b/.config/nvim/lua/rahcodes/init.lua @@ -0,0 +1,3 @@ +require("rahcodes.set") +require("rahcodes.remap") +require("rahcodes.packer") diff --git a/.config/nvim/lua/rahcodes/keymap.lua b/.config/nvim/lua/rahcodes/keymap.lua new file mode 100644 index 00000000..463c1881 --- /dev/null +++ b/.config/nvim/lua/rahcodes/keymap.lua @@ -0,0 +1,20 @@ +local M = {} + +local function bind(op, outer_opts) + outer_opts = outer_opts or {noremap = true} + return function(lhs, rhs, opts) + opts = vim.tbl_extend("force", + outer_opts, + opts or {} + ) + vim.keymap.set(op, lhs,rhs, opts) + end +end + +M.nmap = bind("n", {noremap = false}) +M.nnoremap = bind("n") +M.vnoremap = bind("v") +M.xnoremap = bind("x") +M.inoremap = bind("i") + +return M diff --git a/.config/nvim/lua/rahcodes/packer.lua b/.config/nvim/lua/rahcodes/packer.lua new file mode 100644 index 00000000..3fbcb28e --- /dev/null +++ b/.config/nvim/lua/rahcodes/packer.lua @@ -0,0 +1,80 @@ +-- This file can be loaded by calling `lua require('plugins')` from your init.vim +local ensure_packer = function() + 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 + fn.system({ "git", "clone", "--depth", "1", "https://github.com/wbthomason/packer.nvim", install_path }) + vim.cmd([[packadd packer.nvim]]) + return true + end + return false +end + +local packer_bootstrap = ensure_packer() + +return require("packer").startup(function(use) + -- Packer can manage itself + use("wbthomason/packer.nvim") + use("folke/tokyonight.nvim") + use({ + "nvim-telescope/telescope.nvim", + tag = "0.1.0", + requires = { { "nvim-lua/plenary.nvim" } }, + }) + use({ + "nvim-treesitter/nvim-treesitter", + run = function() + local ts_update = require("nvim-treesitter.install").update({ with_sync = true }) + ts_update() + end, + }) + use({ "williamboman/mason.nvim" }) + use({ "williamboman/mason-lspconfig.nvim" }) + + -- configure lsp servers + use("neovim/nvim-lspconfig") + use("hrsh7th/cmp-nvim-lsp") + use("hrsh7th/cmp-buffer") + use("hrsh7th/nvim-cmp") + -- use("tzachar/cmp-tabnine", { run = "./install.sh" }) + use("onsails/lspkind-nvim") + use("nvim-lua/lsp_extensions.nvim") + use("glepnir/lspsaga.nvim") + use("simrat39/symbols-outline.nvim") + use("L3MON4D3/LuaSnip") + use("saadparwaiz1/cmp_luasnip") + + -- formatting & linting + use("jose-elias-alvarez/null-ls.nvim") + use("jayp0521/mason-null-ls.nvim") + + use({ + "nvim-lualine/lualine.nvim", + requires = { "nvim-tree/nvim-web-devicons", opt = true }, + }) + + use({ + "lewis6991/gitsigns.nvim", + config = function() + require("gitsigns").setup() + end, + }) + + use({ + "folke/trouble.nvim", + requires = "kyazdani42/nvim-web-devicons", + config = function() + require("trouble").setup({ + -- your configuration comes here + -- or leave it empty to use the default settings + -- refer to the configuration section below + }) + end, + }) + + -- 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/.config/nvim/lua/rahcodes/remap.lua b/.config/nvim/lua/rahcodes/remap.lua new file mode 100644 index 00000000..8578e44b --- /dev/null +++ b/.config/nvim/lua/rahcodes/remap.lua @@ -0,0 +1,14 @@ +local nnoremap = require("rahcodes.keymap").nnoremap + +nnoremap("pv", "Ex") + +local builtin = require('telescope.builtin') +vim.keymap.set('n', 'ff', builtin.find_files, {}) +vim.keymap.set('n', 'fg', builtin.live_grep, {}) +vim.keymap.set('n', 'fb', builtin.buffers, {}) +vim.keymap.set('n', 'fh', builtin.help_tags, {}) + +vim.keymap.set('n', 'm', builtin.oldfiles, {}) +vim.keymap.set('n', 'gb', builtin.git_branches, {}) +vim.keymap.set('n', 'gs', builtin.git_status, {}) +vim.keymap.set('n', '', builtin.git_files, {}) diff --git a/.config/nvim/lua/rahcodes/set.lua b/.config/nvim/lua/rahcodes/set.lua new file mode 100644 index 00000000..93762f1f --- /dev/null +++ b/.config/nvim/lua/rahcodes/set.lua @@ -0,0 +1,22 @@ +vim.opt.guicursor = "" + +vim.opt.nu = true +vim.opt.relativenumber = true + +vim.opt.tabstop = 2 +vim.opt.softtabstop = 2 +vim.opt.shiftwidth = 2 +vim.opt.expandtab = true +vim.opt.hlsearch = false +vim.opt.incsearch = true + +vim.opt.smartindent = true + +vim.opt.wrap = false + +vim.g.mapleader = " " + +vim.g.netrw_browse_split = 0 +vim.g.netrw_banner = 0 +vim.g.netrw_winsize = 25 + diff --git a/.config/nvim/plugin/coc.vim b/.config/nvim/plugin/coc.vim deleted file mode 100644 index 0a72ef83..00000000 --- a/.config/nvim/plugin/coc.vim +++ /dev/null @@ -1,114 +0,0 @@ -" Use tab for trigger completion with characters ahead and navigate. -inoremap - \ pumvisible() ? "\" : - \ check_back_space() ? "\" : - \ coc#refresh() -inoremap pumvisible() ? "\" : "\" - -function! s:check_back_space() abort - let col = col('.') - 1 - return !col || getline('.')[col - 1] =~# '\s' -endfunction - -" Use to trigger completion. -if has('nvim') - inoremap coc#refresh() -else - inoremap coc#refresh() -endif - -" Make auto-select the first completion item and notify coc.nvim to -" format on enter, could be remapped by other vim plugin -inoremap pumvisible() ? coc#_select_confirm() - \: "\u\\=coc#on_enter()\" - -inoremap pumvisible() ? "\" : "\u\" -" Use `[g` and `]g` to navigate diagnostics -" Use `:CocDiagnostics` to get all diagnostics of current buffer in location list. -nmap [g (coc-diagnostic-prev) -nmap ]g (coc-diagnostic-next) - -" GoTo code navigation. -nmap gd (coc-definition) -nmap gy (coc-type-definition) -nmap gi (coc-implementation) -nmap gr (coc-references) - -" Use K to show documentation in preview window. -nnoremap K :call show_documentation() - -function! s:show_documentation() - if (index(['vim','help'], &filetype) >= 0) - execute 'h '.expand('') - elseif (coc#rpc#ready()) - call CocActionAsync('doHover') - else - execute '!' . &keywordprg . " " . expand('') - endif -endfunction - -" Highlight the symbol and its references when holding the cursor. -autocmd CursorHold * silent call CocActionAsync('highlight') - -" Symbol renaming. -nmap rn (coc-rename) - -" Formatting selected code. -xmap f (coc-format-selected) -nmap f (coc-format-selected) - -augroup mygroup - autocmd! - " Setup formatexpr specified filetype(s). - autocmd FileType typescript,json setl formatexpr=CocAction('formatSelected') - " Update signature help on jump placeholder. - autocmd User CocJumpPlaceholder call CocActionAsync('showSignatureHelp') -augroup end - -" Applying codeAction to the selected region. -" Example: `aap` for current paragraph -xmap a (coc-codeaction-selected) -nmap a (coc-codeaction-selected) - -" Remap keys for applying codeAction to the current buffer. -nmap ac (coc-codeaction) -" Apply AutoFix to problem on the current line. -nmap qf (coc-fix-current) - -command! -nargs=0 Prettier :CocCommand prettier.formatFile - -" Add `:Format` command to format current buffer. -command! -nargs=0 Format :call CocAction('format') - -" Add `:Fold` command to fold current buffer. -command! -nargs=? Fold :call CocAction('fold', ) - -" Add `:OR` command for organize imports of the current buffer. -command! -nargs=0 OR :call CocAction('runCommand', 'editor.action.organizeImport') - -" " Remap and for scroll float windows/popups. -if has('nvim-0.4.0') || has('patch-8.2.0750') - nnoremap coc#float#has_scroll() ? coc#float#scroll(1) : "\" - nnoremap coc#float#has_scroll() ? coc#float#scroll(0) : "\" - inoremap coc#float#has_scroll() ? "\=coc#float#scroll(1)\" : "\" - inoremap coc#float#has_scroll() ? "\=coc#float#scroll(0)\" : "\" - vnoremap coc#float#has_scroll() ? coc#float#scroll(1) : "\" - vnoremap coc#float#has_scroll() ? coc#float#scroll(0) : "\" -endif - -let g:coc_global_extensions = [ - \'coc-tsserver', - \'coc-css', - \'coc-eslint', - \'coc-highlight', - \'coc-html', - \'coc-prettier', - \'coc-solargraph', - \'coc-vimlsp', - \'coc-actions', - \'coc-go', - \'coc-explorer', - \'coc-json', - \'coc-git' - \] - diff --git a/.config/nvim/plugin/packer_compiled.lua b/.config/nvim/plugin/packer_compiled.lua new file mode 100644 index 00000000..695af348 --- /dev/null +++ b/.config/nvim/plugin/packer_compiled.lua @@ -0,0 +1,220 @@ +-- Automatically generated packer.nvim plugin loader code + +if vim.api.nvim_call_function('has', {'nvim-0.5'}) ~= 1 then + vim.api.nvim_command('echohl WarningMsg | echom "Invalid Neovim version for packer.nvim! | echohl None"') + return +end + +vim.api.nvim_command('packadd packer.nvim') + +local no_errors, error_msg = pcall(function() + +_G._packer = _G._packer or {} +_G._packer.inside_compile = true + +local time +local profile_info +local should_profile = false +if should_profile then + local hrtime = vim.loop.hrtime + profile_info = {} + time = function(chunk, start) + if start then + profile_info[chunk] = hrtime() + else + profile_info[chunk] = (hrtime() - profile_info[chunk]) / 1e6 + end + end +else + time = function(chunk, start) end +end + +local function save_profiles(threshold) + local sorted_times = {} + for chunk_name, time_taken in pairs(profile_info) do + sorted_times[#sorted_times + 1] = {chunk_name, time_taken} + end + table.sort(sorted_times, function(a, b) return a[2] > b[2] end) + local results = {} + for i, elem in ipairs(sorted_times) do + if not threshold or threshold and elem[2] > threshold then + results[i] = elem[1] .. ' took ' .. elem[2] .. 'ms' + end + end + if threshold then + table.insert(results, '(Only showing plugins that took longer than ' .. threshold .. ' ms ' .. 'to load)') + end + + _G._packer.profile_output = results +end + +time([[Luarocks path setup]], true) +local package_path_str = "/home/striderz/.cache/nvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/?.lua;/home/striderz/.cache/nvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/?/init.lua;/home/striderz/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/?.lua;/home/striderz/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/?/init.lua" +local install_cpath_pattern = "/home/striderz/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/lua/5.1/?.so" +if not string.find(package.path, package_path_str, 1, true) then + package.path = package.path .. ';' .. package_path_str +end + +if not string.find(package.cpath, install_cpath_pattern, 1, true) then + package.cpath = package.cpath .. ';' .. install_cpath_pattern +end + +time([[Luarocks path setup]], false) +time([[try_loadstring definition]], true) +local function try_loadstring(s, component, name) + local success, result = pcall(loadstring(s), name, _G.packer_plugins[name]) + if not success then + vim.schedule(function() + vim.api.nvim_notify('packer.nvim: Error running ' .. component .. ' for ' .. name .. ': ' .. result, vim.log.levels.ERROR, {}) + end) + end + return result +end + +time([[try_loadstring definition]], false) +time([[Defining packer_plugins]], true) +_G.packer_plugins = { + LuaSnip = { + loaded = true, + path = "/home/striderz/.local/share/nvim/site/pack/packer/start/LuaSnip", + url = "https://github.com/L3MON4D3/LuaSnip" + }, + ["cmp-buffer"] = { + loaded = true, + path = "/home/striderz/.local/share/nvim/site/pack/packer/start/cmp-buffer", + url = "https://github.com/hrsh7th/cmp-buffer" + }, + ["cmp-nvim-lsp"] = { + loaded = true, + path = "/home/striderz/.local/share/nvim/site/pack/packer/start/cmp-nvim-lsp", + url = "https://github.com/hrsh7th/cmp-nvim-lsp" + }, + cmp_luasnip = { + loaded = true, + path = "/home/striderz/.local/share/nvim/site/pack/packer/start/cmp_luasnip", + url = "https://github.com/saadparwaiz1/cmp_luasnip" + }, + ["gitsigns.nvim"] = { + config = { "\27LJ\2\n6\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\rgitsigns\frequire\0" }, + loaded = true, + path = "/home/striderz/.local/share/nvim/site/pack/packer/start/gitsigns.nvim", + url = "https://github.com/lewis6991/gitsigns.nvim" + }, + ["lsp_extensions.nvim"] = { + loaded = true, + path = "/home/striderz/.local/share/nvim/site/pack/packer/start/lsp_extensions.nvim", + url = "https://github.com/nvim-lua/lsp_extensions.nvim" + }, + ["lspkind-nvim"] = { + loaded = true, + path = "/home/striderz/.local/share/nvim/site/pack/packer/start/lspkind-nvim", + url = "https://github.com/onsails/lspkind-nvim" + }, + ["lspsaga.nvim"] = { + loaded = true, + path = "/home/striderz/.local/share/nvim/site/pack/packer/start/lspsaga.nvim", + url = "https://github.com/glepnir/lspsaga.nvim" + }, + ["lualine.nvim"] = { + loaded = true, + path = "/home/striderz/.local/share/nvim/site/pack/packer/start/lualine.nvim", + url = "https://github.com/nvim-lualine/lualine.nvim" + }, + ["mason-lspconfig.nvim"] = { + loaded = true, + path = "/home/striderz/.local/share/nvim/site/pack/packer/start/mason-lspconfig.nvim", + url = "https://github.com/williamboman/mason-lspconfig.nvim" + }, + ["mason-null-ls.nvim"] = { + loaded = true, + path = "/home/striderz/.local/share/nvim/site/pack/packer/start/mason-null-ls.nvim", + url = "https://github.com/jayp0521/mason-null-ls.nvim" + }, + ["mason.nvim"] = { + loaded = true, + path = "/home/striderz/.local/share/nvim/site/pack/packer/start/mason.nvim", + url = "https://github.com/williamboman/mason.nvim" + }, + ["null-ls.nvim"] = { + loaded = true, + path = "/home/striderz/.local/share/nvim/site/pack/packer/start/null-ls.nvim", + url = "https://github.com/jose-elias-alvarez/null-ls.nvim" + }, + ["nvim-cmp"] = { + loaded = true, + path = "/home/striderz/.local/share/nvim/site/pack/packer/start/nvim-cmp", + url = "https://github.com/hrsh7th/nvim-cmp" + }, + ["nvim-lspconfig"] = { + loaded = true, + path = "/home/striderz/.local/share/nvim/site/pack/packer/start/nvim-lspconfig", + url = "https://github.com/neovim/nvim-lspconfig" + }, + ["nvim-treesitter"] = { + loaded = true, + path = "/home/striderz/.local/share/nvim/site/pack/packer/start/nvim-treesitter", + url = "https://github.com/nvim-treesitter/nvim-treesitter" + }, + ["nvim-web-devicons"] = { + loaded = false, + needs_bufread = false, + path = "/home/striderz/.local/share/nvim/site/pack/packer/opt/nvim-web-devicons", + url = "https://github.com/nvim-tree/nvim-web-devicons" + }, + ["packer.nvim"] = { + loaded = true, + path = "/home/striderz/.local/share/nvim/site/pack/packer/start/packer.nvim", + url = "https://github.com/wbthomason/packer.nvim" + }, + ["plenary.nvim"] = { + loaded = true, + path = "/home/striderz/.local/share/nvim/site/pack/packer/start/plenary.nvim", + url = "https://github.com/nvim-lua/plenary.nvim" + }, + ["symbols-outline.nvim"] = { + loaded = true, + path = "/home/striderz/.local/share/nvim/site/pack/packer/start/symbols-outline.nvim", + url = "https://github.com/simrat39/symbols-outline.nvim" + }, + ["telescope.nvim"] = { + loaded = true, + path = "/home/striderz/.local/share/nvim/site/pack/packer/start/telescope.nvim", + url = "https://github.com/nvim-telescope/telescope.nvim" + }, + ["tokyonight.nvim"] = { + loaded = true, + path = "/home/striderz/.local/share/nvim/site/pack/packer/start/tokyonight.nvim", + url = "https://github.com/folke/tokyonight.nvim" + }, + ["trouble.nvim"] = { + config = { "\27LJ\2\n9\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\ftrouble\frequire\0" }, + loaded = true, + path = "/home/striderz/.local/share/nvim/site/pack/packer/start/trouble.nvim", + url = "https://github.com/folke/trouble.nvim" + } +} + +time([[Defining packer_plugins]], false) +-- Config for: trouble.nvim +time([[Config for trouble.nvim]], true) +try_loadstring("\27LJ\2\n9\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\ftrouble\frequire\0", "config", "trouble.nvim") +time([[Config for trouble.nvim]], false) +-- Config for: gitsigns.nvim +time([[Config for gitsigns.nvim]], true) +try_loadstring("\27LJ\2\n6\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\rgitsigns\frequire\0", "config", "gitsigns.nvim") +time([[Config for gitsigns.nvim]], false) + +_G._packer.inside_compile = false +if _G._packer.needs_bufread == true then + vim.cmd("doautocmd BufRead") +end +_G._packer.needs_bufread = false + +if should_profile then save_profiles() end + +end) + +if not no_errors then + error_msg = error_msg:gsub('"', '\\"') + vim.api.nvim_command('echohl ErrorMsg | echom "Error in packer_compiled: '..error_msg..'" | echom "Please check your config for correctness" | echohl None') +end diff --git a/.config/nvim/plugin/sets.vim b/.config/nvim/plugin/sets.vim deleted file mode 100644 index 4275395a..00000000 --- a/.config/nvim/plugin/sets.vim +++ /dev/null @@ -1,58 +0,0 @@ - -set rtp+=/usr/local/opt/fzf -set background=dark -set nowrap -set textwidth=79 -set formatoptions=qrn1 - -set ignorecase -set smartcase -set gdefault - -set incsearch -set showmatch -set hlsearch -set nocompatible -set exrc - -set modelines=0 -set tabstop=4 -set shiftwidth=4 -set softtabstop=4 -set expandtab - -set encoding=utf-8 -set scrolloff=8 -set autoindent -set smartindent -set showmode -set showcmd -set cmdheight=2 -set hidden -set wildmenu -set wildmode=list:longest -set visualbell -set cursorline -set ttyfast -set ruler -set backspace=indent,eol,start -set laststatus=2 -set relativenumber -set nu -set noswapfile -set nobackup -set nowritebackup -set undodir=~/.config/nvim/undodir -set undofile -set signcolumn=yes -set colorcolumn=80 - -" Having longer updatetime (default is 4000 ms = 4 s) leads to noticeable -" delays and poor user experience. -set updatetime=300 - -" Don't pass messages to |ins-completion-menu|. -set shortmess+=c - -set grepprg=rg\ --vimgrep\ --smart-case\ --follow -