this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

add submodule for nvim

+3 -1771
+3
.gitmodules
··· 1 + [submodule "nvim"] 2 + path = nvim 3 + url = https://github.com/boltlessengineer/nvim.git
-65
nvim_old/README.md
··· 1 - # My Neovim Config 2 - 3 - ``` 4 - neovim version : v0.7.0 5 - ``` 6 - 7 - ## Install / Uninstall 8 - 9 - ### Build & Install 10 - 11 - ```bash 12 - xcode-select --Install 13 - # install homebrew 14 - brew install ninja libtool automake cmake pkg-config gettext curl 15 - 16 - git clone https://github.com/neovim/neovim 17 - cd neovim 18 - # remove build files (when re-build) 19 - rm -rf build .deps 20 - make CMAKE_BUILD_TYPE=RelWithDebInfo 21 - sudo make install 22 - # (now installed at `/usr/local`) 23 - ``` 24 - 25 - ### Uninstall 26 - 27 - ```bash 28 - sudo rm /usr/local/bin/nvim 29 - sudo rm -r /usr/local/share/nvim 30 - ``` 31 - 32 - ## TODO 33 - 34 - - [x] Find why print `xterm-256color` on startup 35 - - [ ] fix notify.nvim word wrap issue 36 - - [ ] better ts-parser & LSP for MarkDown 37 - - [ ] Find way to run multiple lua commands 38 - - [ ] sumneko/lua-language-server EmmyLua-Annotiations error at 39 - 40 - ``` 41 - { 42 - new: function, <- reason (function defined another place) 43 - on_close: fun(term: Terminal), 44 - } <- highlight error here 45 - ``` 46 - 47 - check : [sumneko/lua-language-server](https://github.com/sumneko/lua-language-server/wiki/EmmyLua-Annotations) 48 - 49 - - [ ] Toggle inline comment in INSERT mode 50 - - [ ] give more width to `Telescope help_tags` preview 51 - - [x] add `smjonas/inc-rename.nvim` 52 - - [ ] show where I can jump with `<C-o>` (jumplist?) 53 - - [x] `go_to_next_hunk` feature 54 - - [ ] markdown preview with image previewer (w3img, imgcat...) 55 - - [ ] don't create comment automatically when `<S-CR>` in INSERT mode 56 - - [ ] add shortcut to start edit on next function's param space (`myfunc (|)`) 57 - - [ ] NeoTerm.nvim 58 - - [ ] Open Terminal & save bufnr to global variable 59 - - [ ] Right | Bottom | Left | (maybe Top..?) 60 - - [ ] **Float** 61 - - [ ] Bufnr ignore (Bufline... check toggleterm) 62 - - [ ] Switch Terminal 63 - - [ ] Send message to other terminal buffer 64 - - [ ] Provide all these with lua functions 65 - - [ ] plugin to edit register easily <https://www.youtube.com/watch?v=I5QGlfbuCfs>
-3
nvim_old/after/ftplugin/go.vim
··· 1 - setlocal shiftwidth=4 2 - setlocal tabstop=4 3 - setlocal noexpandtab
-30
nvim_old/init.lua
··· 1 - require 'core.options' 2 - require 'core.keymaps' 3 - require 'core.plugins' 4 - require 'core.colorscheme' 5 - require 'core.autocmds' 6 - require 'core.lsp' 7 - 8 - require 'plugins.cmp' 9 - require 'plugins.telescope' 10 - require 'plugins.treesitter' 11 - require 'plugins.comment' 12 - require 'plugins.todo-comments' 13 - require 'plugins.autopairs' 14 - require 'plugins.gitsigns' 15 - require 'plugins.nvim-tree' 16 - require 'plugins.bufferline' 17 - require 'plugins.lualine' 18 - require 'plugins.toggleterm' 19 - require 'plugins.alpha' 20 - require 'plugins.whichkey' 21 - require 'plugins.illuminate' 22 - require 'plugins.notify' 23 - require 'plugins.indentblankline' 24 - require 'plugins.neorg' 25 - require 'plugins.neogit' 26 - require 'plugins.diffview' 27 - -- require 'plugins.project' 28 - require 'plugins.inc-rename' 29 - 30 - require 'ui.winbar'
-15
nvim_old/lua/core/autocmds.lua
··· 1 - vim.api.nvim_create_autocmd({ 'TermOpen', 'BufEnter' }, { 2 - pattern = 'term://*', 3 - callback = function(opts) 4 - vim.api.nvim_buf_set_option(opts.buf, 'bufhidden', 'wipe') 5 - vim.opt_local.number = false 6 - vim.opt_local.relativenumber = false 7 - vim.opt_local.cursorline = false 8 - vim.cmd [[startinsert]] 9 - end 10 - }) 11 - 12 - vim.api.nvim_create_user_command('Vterm', function() 13 - vim.cmd [[split]] 14 - vim.cmd [[term]] 15 - end, {})
-62
nvim_old/lua/core/colorscheme.lua
··· 1 - -- Tokyonight config 2 - 3 - vim.g.tokyonight_style = 'night' 4 - -- Add transparent in graphical applications 5 - if vim.fn.expand('$TERM') ~= '' then 6 - vim.g.tokyonight_transparent = true 7 - vim.g.tokyonight_transparent_sidebar = false 8 - end 9 - 10 - local colorscheme = 'tokyonight' 11 - 12 - -- Load the colorscheme 13 - local ok, _ = pcall(vim.cmd, 'colorscheme ' .. colorscheme) 14 - if not ok then 15 - vim.notify('colorscheme ' .. colorscheme .. ' not found!') 16 - return 17 - end 18 - 19 - -- Additional highlights 20 - -- TODO: make PR about these 21 - local c = require('tokyonight.colors').setup() 22 - local util = require('tokyonight.util') 23 - -- vim.highlight.link('TreesitterContext', 'CursorLine') 24 - -- vim.highlight.link('TreesitterContextLineNumber', 'PmenuSel') 25 - util.highlight('TreesitterContext', { bg = c.bg_highlight }) 26 - util.highlight('TreesitterContextLineNumber', { fg = c.comment, bg = c.bg_highlight }) 27 - util.highlight('IndentBlanklineChar', { fg = c.fg_gutter }) 28 - util.highlight('IndentBlanklineContextChar', { fg = c.dark5 }) 29 - util.highlight('NavicText', { fg = c.dark5 }) 30 - util.highlight('NavicSeparator', { fg = c.fg_gutter }) 31 - util.highlight('NvimTreeWinSeparator', { fg = c.bg_sidebar, bg = c.bg_sidebar }) 32 - local items = { 33 - 'File', 34 - 'Module', 35 - 'Namespace', 36 - 'Package', 37 - 'Class', 38 - 'Method', 39 - 'Property', 40 - 'Field', 41 - 'Constructor', 42 - 'Enum', 43 - 'Interface', 44 - 'Function', 45 - 'Variable', 46 - 'Constant', 47 - 'String', 48 - 'Number', 49 - 'Boolean', 50 - 'Array', 51 - 'Object', 52 - 'Key', 53 - 'Null', 54 - 'EnumMember', 55 - 'Struct', 56 - 'Event', 57 - 'Operator', 58 - 'TypeParameter', 59 - } 60 - for _, item in pairs(items) do 61 - vim.cmd('hi link NavicIcons' .. item .. ' CmpItemKind' .. item) 62 - end
-94
nvim_old/lua/core/keymaps.lua
··· 1 - -- Shorten function name 2 - local set = vim.keymap.set 3 - -- local del = vim.keymap.del 4 - 5 - -- Remap space as leader key 6 - set('', '<Space>', '<Nop>') 7 - vim.g.mapleader = ' ' 8 - vim.g.maplocalleader = ' ' 9 - 10 - -- Modes 11 - -- n : normal mode 12 - -- i : insert mode 13 - -- v : visual mode & select mode 14 - -- x : visual mode only 15 - -- s : select mode only 16 - -- t : terminal mode 17 - -- c : command mode 18 - 19 - -- Normal -- 20 - -- Better window navigation 21 - set('n', '<C-h>', '<C-w>h') 22 - set('n', '<C-j>', '<C-w>j') 23 - set('n', '<C-k>', '<C-w>k') 24 - set('n', '<C-l>', '<C-w>l') 25 - set('t', '<C-h>', [[<C-\><C-n><C-w>h]]) 26 - set('t', '<C-j>', [[<C-\><C-n><C-w>j]]) 27 - set('t', '<C-k>', [[<C-\><C-n><C-w>k]]) 28 - set('t', '<C-l>', [[<C-\><C-n><C-w>l]]) 29 - 30 - -- Resize with arrows 31 - set('n', '<C-w><Up>', '<C-w>+') 32 - set('n', '<C-w><Down>', '<C-w>-') 33 - set('n', '<C-w><Left>', '<C-w><') 34 - set('n', '<C-w><Right>', '<C-w>>') 35 - 36 - -- Navigate buffers 37 - set('n', '<Right>', '<cmd>BufferLineCycleNext<CR>') 38 - set('n', '<Left>', '<cmd>BufferLineCyclePrev<CR>') 39 - 40 - -- Navigate tabs 41 - set('n', '<Tab>', '<cmd>tabnext<CR>') 42 - set('n', '<S-Tab>', '<cmd>tabprev<CR>') 43 - 44 - -- Keeping search results centered 45 - set('n', 'n', 'nzzzv') 46 - set('n', 'N', 'Nzzzv') 47 - 48 - -- Smart dd (don't override register when deleting empty line) 49 - -- inspired by u/JoseConseco_'s 'smart dd' post 50 - local function smart_dd() 51 - local current_line = '' .. vim.api.nvim_get_current_line() 52 - if current_line:match('^%s*$') then 53 - print('dont yank') 54 - return '"_dd' 55 - else 56 - print('yank') 57 - return 'dd' 58 - end 59 - end 60 - 61 - set('n', 'dd', smart_dd, { expr = true }) 62 - 63 - -- Smart closing 64 - local function smart_close() 65 - if not pcall(vim.cmd.close) then 66 - vim.cmd.bd() 67 - end 68 - end 69 - 70 - set('n', '<leader>q', smart_close) 71 - 72 - set('n', '<C-e>', '<cmd>NvimTreeToggle<CR>') 73 - 74 - -- Insert -- 75 - -- Press jk fast to exit Insert | Visual mode 76 - set({ 'i', 'v' }, 'jk', '<ESC>') 77 - set({ 'i', 'v' }, 'kj', '<ESC>') 78 - 79 - -- TODO using clipboard in graphical applications 80 - -- https://github.com/neovide/neovide/issues/1282#issuecomment-1108646687 81 - -- `"+y` to copy, `"+p` to paste 82 - -- `<D-` stands for super key. see `:h <D-` 83 - vim.g.neovide_input_use_logo = true 84 - set('v', '<D-c>', '<cmd>echo "want to copy"<CR>') 85 - set('v', '<D-v>', '<cmd>echo "want to paste"<CR>') 86 - 87 - -- Visual -- 88 - -- Stay in indent mode 89 - set('v', '<', '<gv') 90 - set('v', '>', '>gv') 91 - 92 - -- Move text opt and down 93 - set('v', 'J', ":m '>+1<CR>gv=gv") 94 - set('v', 'K', ":m '<-2<CR>gv=gv")
-33
nvim_old/lua/core/lsp/configs.lua
··· 1 - -- Install loved servers 2 - local servers = { 3 - 'clangd', 4 - 'gopls', 5 - 'jsonls', 6 - 'sumneko_lua', 7 - 'tailwindcss', 8 - 'tsserver', 9 - 'html', 10 - } 11 - 12 - local installer_ok, lsp_installer = pcall(require, 'nvim-lsp-installer') 13 - if installer_ok then 14 - lsp_installer.setup { 15 - ensure_installed = servers, 16 - } 17 - end 18 - 19 - local lspconfig = require('lspconfig') 20 - 21 - for _, server in pairs(servers) do 22 - -- TODO: get server list from lsp_installer get server list, 23 - -- not local servers{} in config file 24 - local opts = { 25 - on_attach = require('core.lsp.handlers').on_attach, 26 - capabilities = require('core.lsp.handlers').capabilities, 27 - } 28 - local has_custom_opts, server_custom_opts = pcall(require, 'core.lsp.settings.' .. server) 29 - if has_custom_opts then 30 - opts = vim.tbl_deep_extend('force', server_custom_opts, opts) 31 - end 32 - lspconfig[server].setup(opts) 33 - end
-111
nvim_old/lua/core/lsp/handlers.lua
··· 1 - local M = {} 2 - 3 - M.setup = function() 4 - local signs = { 5 - { name = 'DiagnosticSignError', text = '' }, 6 - { name = 'DiagnosticSignWarn', text = '' }, 7 - { name = 'DiagnosticSignHint', text = '' }, 8 - { name = 'DiagnosticSignInfo', text = '' }, 9 - } 10 - 11 - for _, sign in ipairs(signs) do 12 - vim.fn.sign_define(sign.name, { texthl = sign.name, text = sign.text, numhl = '' }) 13 - end 14 - 15 - vim.diagnostic.config({ 16 - -- enable virtual text 17 - virtual_text = true, 18 - -- show signs 19 - signs = { 20 - active = signs, 21 - }, 22 - update_in_insert = true, 23 - underline = true, 24 - severity_sort = true, 25 - float = { 26 - focusable = false, 27 - style = 'minimal', 28 - border = 'rounded', 29 - source = 'always', 30 - header = '', 31 - prefix = '', 32 - }, 33 - }) 34 - 35 - vim.lsp.handlers['textDocument/hover'] = vim.lsp.with(vim.lsp.handlers.hover, { 36 - border = 'rounded', 37 - }) 38 - 39 - vim.lsp.handlers['textDocument/signatureHelp'] = vim.lsp.with(vim.lsp.handlers.signature_help, { 40 - border = 'rounded', 41 - }) 42 - end 43 - 44 - local function lsp_highlight_document(client) 45 - if client.server_capabilities.documentHighlightProvider then 46 - local status_ok, illuminate = pcall(require, 'illuminate') 47 - if not status_ok then 48 - return 49 - end 50 - illuminate.on_attach(client) 51 - end 52 - end 53 - 54 - local function lsp_keymaps(bufnr) 55 - -- TODO: change this to vim.keymap.set() 56 - local opts = { noremap = true, silent = true } 57 - local function buf_set_keymap(...) vim.api.nvim_buf_set_keymap(bufnr, ...) end 58 - 59 - -- See `:help vim.lsp.*` for documentation on any of the below functions 60 - buf_set_keymap('n', 'ga', '<cmd>lua vim.lsp.buf.code_action()<CR>', opts) 61 - buf_set_keymap('n', 'gd', '<cmd>lua vim.lsp.buf.definition()<CR>', opts) 62 - buf_set_keymap('n', 'gr', '<cmd>lua vim.lsp.buf.rename()<CR>', opts) 63 - buf_set_keymap('n', 'gh', '<cmd>lua vim.lsp.buf.definition()<CR>', opts) 64 - buf_set_keymap('n', 'K', '<cmd>lua vim.lsp.buf.hover()<CR>', opts) 65 - -- buf_set_keymap('n', '<C-j>', '<cmd>lua vim.diagnostic.goto_next()<CR>', opts) 66 - -- TODO: <C-k> to <C-/> 67 - buf_set_keymap('i', '<C-k>', '<cmd>lua vim.lsp.buf.signature_help()<CR>', opts) 68 - end 69 - 70 - local augroup = vim.api.nvim_create_augroup('LspAutoFormat', {}) 71 - 72 - M.on_attach = function(client, bufnr) 73 - lsp_keymaps(bufnr) 74 - lsp_highlight_document(client) 75 - local ok, navic = pcall(require, 'nvim-navic') 76 - if ok and client.supports_method('textDocument/documentSymbol') then 77 - if client.name ~= 'html' then 78 - -- TODO: html-ls doesn't suppot documentSymbol 79 - -- https://github.com/microsoft/vscode-html-languageservice/issues/130 80 - navic.attach(client, bufnr) 81 - end 82 - end 83 - -- Setup AutoFormat 84 - if client.supports_method('textDocument/formatting') then 85 - vim.api.nvim_clear_autocmds({ group = augroup, buffer = bufnr }) 86 - vim.api.nvim_create_autocmd('BufWritePre', { 87 - group = augroup, 88 - buffer = bufnr, 89 - callback = function() 90 - vim.lsp.buf.format({ 91 - bufnr = bufnr, 92 - filter = function(c) 93 - return c.name ~= 'tsserver' 94 - end, 95 - -- TODO: need callback to print `Auto-formatted with ~ server` 96 - -- (null-ls formatting should be notified exactly) 97 - }) 98 - end 99 - }) 100 - end 101 - end 102 - 103 - local capabilities = vim.lsp.protocol.make_client_capabilities() 104 - 105 - local ok, cmp_nvim_lsp = pcall(require, 'cmp_nvim_lsp') 106 - if not ok then return end 107 - -- TODO: `return M end` to use neovim's default omnifunc 108 - 109 - M.capabilities = cmp_nvim_lsp.update_capabilities(capabilities) 110 - 111 - return M
-8
nvim_old/lua/core/lsp/init.lua
··· 1 - local ok, _ = pcall(require, 'lspconfig') 2 - if not ok then return end 3 - 4 - require('core.lsp.configs') 5 - require('core.lsp.handlers').setup() 6 - require('core.lsp.null-ls') 7 - 8 - -- require("core.lsp.specifics.flutter")
-52
nvim_old/lua/core/lsp/null-ls.lua
··· 1 - -- null_ls vs diagnostic_ls 2 - local ok, null_ls = pcall(require, 'null-ls') 3 - if not ok then 4 - return 5 - end 6 - 7 - local b = null_ls.builtins 8 - 9 - local eslintConfig = { 10 - condition = function(utils) 11 - return utils.root_has_file({ '.eslintrc.json' }) 12 - end, 13 - } 14 - 15 - null_ls.setup({ 16 - debug = true, 17 - sources = { 18 - -- stylua (lua) 19 - -- > cargo install stylua 20 - -- > brew install stylua 21 - -- b.formatting.stylua, 22 - 23 - -- eslint_d (js) 24 - -- > npm install -g eslint_d 25 - b.diagnostics.eslint_d.with(eslintConfig), 26 - b.code_actions.eslint_d.with(eslintConfig), 27 - 28 - -- prettierd 29 - -- > npm install -g @fsouza/prettierd 30 - b.formatting.prettierd.with({ 31 - -- TODO: create default prettierrc.json 32 - -- env = { 33 - -- PRETTIERD_DEFAULT_CONFIG = vim.fn.expand('~/.config/nvim/~~~/.prettierrc.json'), 34 - -- }, 35 - }), 36 - }, 37 - on_attach = function(client, bufnr) 38 - local augroup = vim.api.nvim_create_augroup('LspFormatting', { clear = false }) 39 - -- TODO: organize augroups as lua module ('core.augroups') 40 - if client.supports_method('textDocument/formatting') then 41 - vim.api.nvim_clear_autocmds({ group = augroup, buffer = bufnr }) 42 - vim.api.nvim_create_autocmd('BufWritePre', { 43 - group = augroup, 44 - buffer = bufnr, 45 - callback = function() 46 - vim.lsp.buf.format({ bufnr = bufnr }) 47 - -- (null-ls formatting should be notified exactly) 48 - end 49 - }) 50 - end 51 - end 52 - })
-57
nvim_old/lua/core/lsp/settings/diagnosticls.lua
··· 1 - return { 2 - filetypes = { 'javascript', 'javascriptreact', 'json', 'typescript', 'typescriptreact', 'css', 'less', 'scss', 'pandoc' }, 3 - init_options = { 4 - linters = { 5 - eslint = { 6 - command = 'eslint_d', 7 - rootPatterns = { '.git' }, 8 - debounce = 100, 9 - args = { '--stdin', '--stdin-filename', '%filepath', '--format', 'json' }, 10 - sourceName = 'eslint_d', 11 - -- Using JSON 12 - parseJson = { 13 - errorsRoot = '[0].messages', 14 - line = 'line', 15 - column = 'column', 16 - endLine = 'endLine', 17 - endColumn = 'endColumn', 18 - message = '[eslint] ${message} [${ruleId}]', 19 - security = 'severity', 20 - }, 21 - securities = { 22 - [2] = 'error', 23 - [1] = 'warning' 24 - } 25 - }, 26 - }, 27 - filetypes = { 28 - javascript = 'eslint', 29 - javascriptreact = 'eslint', 30 - typescript = 'eslint', 31 - typescriptreact = 'eslint', 32 - }, 33 - formatters = { 34 - eslint_d = { 35 - command = 'eslint_d', 36 - rootPatterns = { '.git' }, 37 - args = { '--stdin', '--stdin-filename', '%filename', '--fix-to-stdout' }, 38 - }, 39 - prettier = { 40 - command = 'prettier_d_slim', 41 - rootPatterns = { '.git' }, 42 - requiredFiles = { 'prettier.config.js' }, 43 - args = { '--stdin', '--stdin-filepath', '%filename' } 44 - } 45 - }, 46 - formatFiletypes = { 47 - css = 'prettier', 48 - javascript = 'prettier', 49 - javascriptreact = 'prettier', 50 - scss = 'prettier', 51 - less = 'prettier', 52 - typescript = 'prettier', 53 - typescriptreact = 'prettier', 54 - json = 'prettier', 55 - } 56 - } 57 - }
-31
nvim_old/lua/core/lsp/settings/sumneko_lua.lua
··· 1 - -- NOTE: https://rishabhrd.github.io/jekyll/update/2020/09/19/nvim_lsp_config.html#some-lsp-client-configurations 2 - 3 - return { 4 - settings = { 5 - Lua = { 6 - runtime = { 7 - version = 'LuaJIT', 8 - }, 9 - diagnostics = { 10 - -- NOTE: diable `different-requires` to hide warnings 11 - -- https://www.reddit.com/r/neovim/comments/rvc4vo/annoying_lua_warning/ 12 - -- https://www.reddit.com/r/neovim/comments/snmkr3/comment/hw6diw9/ 13 - disable = { 'different-requires' }, 14 - globals = { 'vim' }, 15 - }, 16 - format = { 17 - -- NOTE: refer these for configuration documents. 18 - -- https://github.com/sumneko/lua-language-server/wiki/Code-Formatter 19 - -- https://github.com/CppCXY/EmmyLuaCodeStyle/blob/master/docs/format_config_EN.md 20 - defaultConfig = { 21 - quote_style = 'single', 22 - }, 23 - }, 24 - workspace = { 25 - library = { 26 - vim.fn.expand('$VIMRUNTIME/lua'), 27 - }, 28 - }, 29 - }, 30 - }, 31 - }
-16
nvim_old/lua/core/lsp/settings/tsserver.lua
··· 1 - -- local ts_utils = require("nvim-lsp-ts-utils") 2 - local h = require('core.lsp.handlers') 3 - 4 - return { 5 - filetypes = { 6 - 'javascript', 'javascriptreact', 'javascript.jsx', 7 - 'typescript', 'typescriptreact', 'typescript.tsx' 8 - }, 9 - on_attach = function(client, bufnr) 10 - -- TODO: enable ts_utils 11 - -- ts_utils.setup({}) 12 - -- ts_utils.setup_client(client) 13 - 14 - h.on_attach(client, bufnr) 15 - end 16 - }
-12
nvim_old/lua/core/lsp/specifics/flutter.lua
··· 1 - require('flutter-tools').setup { 2 - decorations = { 3 - statusline = { 4 - app_version = true, 5 - device = true, 6 - } 7 - }, 8 - lsp = { 9 - on_attach = require('user.lsp.handlers').on_attach, 10 - capabilities = require('user.lsp.handlers').capabilities, 11 - } 12 - }
-51
nvim_old/lua/core/options.lua
··· 1 - local options = { 2 - backup = false, -- creates a backup file 3 - clipboard = 'unnamedplus', -- allows neovim to access the system clipboard 4 - -- cmdheight = 2, -- more space in the neovim command line for displaying messages 5 - cmdheight = 1, 6 - completeopt = { 'menuone', 'noselect' }, -- mostly just for cmp 7 - conceallevel = 0, -- so that `` is visible in markdown files 8 - fileencoding = 'utf-8', -- the encoding written to a file 9 - hlsearch = true, -- highlight all matches on previous search pattern 10 - ignorecase = true, -- ignore case in search patterns 11 - mouse = '', -- don't allow the mouse to be used in neovim 12 - pumheight = 10, -- pop up menu height 13 - showmode = false, -- we don't need to see things like -- INSERT -- anymore 14 - showtabline = 2, -- always show tabs 15 - smartcase = true, -- smart case 16 - smartindent = true, -- make indenting smarter again 17 - splitbelow = true, -- force all horizontal splits to go below current window 18 - splitright = true, -- force all vertical splits to go to the right of current window 19 - swapfile = false, -- creates a swapfile 20 - termguicolors = true, -- set term gui colors (most terminals support this) 21 - timeoutlen = 100, -- time to wait for a mapped sequence to complete (in milliseconds) 22 - undofile = true, -- enable persistent undo 23 - updatetime = 300, -- faster completion (4000ms default) 24 - writebackup = false, -- if a file is being edited by another program (or was written to file while editing with another program), it is not allowed to be edited 25 - expandtab = true, -- convert tabs to spaces 26 - shiftwidth = 2, -- the number of spaces inserted for each indentation 27 - tabstop = 2, -- insert 2 spaces for a tab 28 - cursorline = true, -- highlight the current line 29 - number = true, -- set numbered lines 30 - relativenumber = false, -- set relative numbered lines 31 - numberwidth = 2, -- set number column width to 2 {default 4} 32 - signcolumn = 'yes', -- always show the sign column, otherwise it would shift the text each time 33 - colorcolumn = '80', 34 - wrap = false, -- display lines as one long line 35 - scrolloff = 8, -- is one of my fav 36 - sidescrolloff = 8, 37 - guifont = 'FiraCode Nerd Font:h16', -- the font used in graphical neovim applications 38 - whichwrap = '<,>,[,]', 39 - -- NOTE: waiting until 'disabling winbar locally' becames more easier. See neovim#1866 40 - -- winbar = "%{%v:lua.require'ui.winbar'.get_winbar()%}" 41 - } 42 - 43 - for k, v in pairs(options) do 44 - vim.opt[k] = v 45 - end 46 - 47 - vim.opt.shortmess:append 'c' 48 - vim.opt.fillchars:append({ 49 - -- vert = ' ', 50 - diff = '╱', -- TODO: change to dotted slash & change colorscheme to Normal 51 - })
-137
nvim_old/lua/core/plugins.lua
··· 1 - -- vim:fdm=marker 2 - -- Packer.nvim settings {{{ 3 - local fn = vim.fn 4 - 5 - -- Automatically install packer 6 - local install_path = fn.stdpath 'data' .. '/site/pack/packer/start/packer.nvim' 7 - if fn.empty(fn.glob(install_path)) > 0 then 8 - PACKER_BOOTSTRAP = fn.system { 9 - 'git', 10 - 'clone', 11 - '--depth', 12 - '1', 13 - 'https://github.com/wbthomason/packer.nvim', 14 - install_path, 15 - } 16 - print 'Installing packer close and reopen Neovim...' 17 - vim.cmd [[packadd packer.nvim]] 18 - end 19 - 20 - -- Autocommand that reloads neovim whenever you save the plugins.lua file 21 - vim.cmd [[ 22 - augroup packer_user_config 23 - autocmd! 24 - autocmd BufWritePost plugins.lua source <afile> | PackerSync 25 - augroup end 26 - ]] 27 - 28 - -- Use a protected call so we don't error out on first use 29 - local ok, packer = pcall(require, 'packer') 30 - if not ok then 31 - return 32 - end 33 - 34 - -- Have packer use a popup window 35 - packer.init { 36 - display = { 37 - open_fn = function() 38 - return require('packer.util').float { border = 'rounded' } 39 - end, 40 - }, 41 - } 42 - -- }}} 43 - 44 - -- Install plugins here 45 - return packer.startup(function(use) 46 - -- My plugins here 47 - use 'wbthomason/packer.nvim' -- Have packer manage itself 48 - use 'nvim-lua/popup.nvim' -- An implementation of the Popup API from vim in Neovim 49 - use 'nvim-lua/plenary.nvim' -- Useful lua functions used by lots of plugins 50 - use 'windwp/nvim-autopairs' -- Autopairs, integrates with both cmp and treesitter 51 - use 'windwp/nvim-ts-autotag' -- Autotags, = 52 - use 'numToStr/Comment.nvim' -- Easily comment stuff 53 - use 'kyazdani42/nvim-web-devicons' 54 - use 'kyazdani42/nvim-tree.lua' -- File explorer written in lua 55 - use 'akinsho/bufferline.nvim' 56 - use 'nvim-lualine/lualine.nvim' 57 - use 'goolord/alpha-nvim' 58 - use 'ahmedkhalf/project.nvim' 59 - use 'folke/which-key.nvim' 60 - use 'folke/trouble.nvim' 61 - use 'folke/todo-comments.nvim' 62 - use 'rcarriga/nvim-notify' 63 - use 'lukas-reineke/indent-blankline.nvim' 64 - use 'SmiteshP/nvim-navic' 65 - use 'ChristianChiarulli/nvim-gps' 66 - 67 - -- Note 68 - use 'nvim-neorg/neorg' 69 - use { 70 - 'iamcco/markdown-preview.nvim', 71 - run = function() 72 - vim.fn['mkdp#util#install']() 73 - end, 74 - } 75 - 76 - -- Terminal 77 - use { 78 - 'akinsho/toggleterm.nvim', 79 - tag = 'v1.*', 80 - } 81 - 82 - -- Colorschemes 83 - use 'folke/tokyonight.nvim' 84 - 85 - -- cmp plugins 86 - use 'hrsh7th/nvim-cmp' -- The completion plugin 87 - use 'hrsh7th/cmp-buffer' -- buffer completions 88 - use 'hrsh7th/cmp-path' -- path completions 89 - use 'hrsh7th/cmp-cmdline' -- cmdline copletions 90 - use 'saadparwaiz1/cmp_luasnip' -- snippet completions 91 - use 'hrsh7th/cmp-nvim-lsp' -- LSP completions 92 - use 'hrsh7th/cmp-nvim-lua' -- vim lua completions 93 - 94 - -- snippets 95 - use 'L3MON4D3/LuaSnip' -- snippet engine 96 - use 'rafamadriz/friendly-snippets' -- a bunch of snippets to use 97 - 98 - -- LSP 99 - use 'neovim/nvim-lspconfig' -- enable LSP 100 - use 'williamboman/nvim-lsp-installer' -- simple to use language server installer 101 - use 'RRethy/vim-illuminate' -- highlighting other uses of a word 102 - use 'jose-elias-alvarez/null-ls.nvim' -- for formatters and linters 103 - use 'jose-elias-alvarez/nvim-lsp-ts-utils' -- typescript dev utils 104 - -- Language specific plugins (doesn't depend on nvim-lspconfg) 105 - use 'akinsho/flutter-tools.nvim' -- flutter 106 - use 'smjonas/inc-rename.nvim' -- rename with immediate visual feedback 107 - 108 - -- Telescope 109 - use 'nvim-telescope/telescope.nvim' 110 - 111 - -- Treesitter 112 - use { 113 - 'nvim-treesitter/nvim-treesitter', 114 - run = ':TSUpdate', 115 - } 116 - use 'nvim-treesitter/nvim-treesitter-context' 117 - use 'nvim-treesitter/nvim-treesitter-textobjects' 118 - use 'nvim-treesitter/playground' 119 - use 'JoosepAlviste/nvim-ts-context-commentstring' 120 - 121 - -- Git 122 - use 'lewis6991/gitsigns.nvim' 123 - use { 124 - 'TimUntersberger/neogit', 125 - requires = 'nvim-lua/plenary.nvim' 126 - } -- magit clone for neovim 127 - use { 128 - 'sindrets/diffview.nvim', -- single tabpage interface for git diff 129 - requires = 'nvim-lua/plenary.nvim', 130 - } 131 - 132 - -- Automatically set up your configuration after cloning packer.nvim 133 - -- Put this at the end after all plugins 134 - if PACKER_BOOTSTRAP then 135 - require('packer').sync() 136 - end 137 - end)
-46
nvim_old/lua/plugins/alpha.lua
··· 1 - local status_ok, alpha = pcall(require, 'alpha') 2 - if not status_ok then return end 3 - 4 - local dashboard = require 'alpha.themes.dashboard' 5 - dashboard.section.header.val = { 6 - [[ __ ]], 7 - [[ ___ ___ ___ __ __ /\_\ ___ ___ ]], 8 - [[ / _ `\ / __`\ / __`\/\ \/\ \\/\ \ / __` __`\ ]], 9 - [[/\ \/\ \/\ __//\ \_\ \ \ \_/ |\ \ \/\ \/\ \/\ \ ]], 10 - [[\ \_\ \_\ \____\ \____/\ \___/ \ \_\ \_\ \_\ \_\]], 11 - [[ \/_/\/_/\/____/\/___/ \/__/ \/_/\/_/\/_/\/_/]], 12 - } 13 - dashboard.section.buttons.val = { 14 - dashboard.button('e', ' > New file', ':enew <BAR> startinsert <CR>'), 15 - dashboard.button('f', ' > Find file', ':Telescope find_files <CR>'), 16 - dashboard.button('r', ' > Recent files', ':Telescope oldfiles <CR>'), 17 - -- dashboard.button('p', ' > Recent Projects', ':Telescope projects <CR>'), 18 - dashboard.button('c', ' > Config', ':cd ~/.config/nvim <BAR> e ./init.lua <CR>'), 19 - dashboard.button('u', ' > Update plugins', ':PackerSync <CR>'), 20 - dashboard.button('q', ' > Quit', ':qa <CR>'), 21 - } 22 - 23 - dashboard.section.footer.val = function() 24 - return 'boltlessengieer.tistory.com' 25 - end 26 - 27 - vim.api.nvim_create_augroup('alpha_tabline', { clear = true }) 28 - vim.api.nvim_create_autocmd('FileType', { 29 - group = 'alpha_tabline', 30 - pattern = 'alpha', 31 - command = 'set showtabline=0 laststatus=0 noruler', 32 - }) 33 - vim.api.nvim_create_autocmd('FileType', { 34 - group = 'alpha_tabline', 35 - pattern = 'alpha', 36 - callback = function() 37 - vim.api.nvim_create_autocmd('BufUnload', { 38 - group = 'alpha_tabline', 39 - buffer = 0, 40 - command = 'set showtabline=2 laststatus=3 ruler' 41 - }) 42 - end 43 - }) 44 - 45 - -- dashboard.opts.opts.noautocmd = true 46 - alpha.setup(dashboard.opts)
-31
nvim_old/lua/plugins/autopairs.lua
··· 1 - local ok, autopairs = pcall(require, 'nvim-autopairs') 2 - if not ok then 3 - return 4 - end 5 - 6 - autopairs.setup { 7 - check_ts = true, 8 - ts_config = { 9 - lua = { 'string', 'source' }, 10 - javascript = { 'string', 'template_string' }, 11 - }, 12 - disable_filetype = { 'TelescopePrompt', 'spectre_panel' }, 13 - fast_wrap = { 14 - map = '<C-p>', 15 - chars = { '{', '[', '(', '"', "'" }, 16 - pattern = string.gsub([[ [%'%"%)%>%]%)%}%,] ]], '%s+', ''), 17 - offset = 0, -- Offset from pattern match 18 - keys = 'qwertyuiopzxcvbnmasdfghjkl', 19 - end_key = '$', 20 - check_comma = true, 21 - highlight = 'Search', 22 - highlight_grey = 'Comment', 23 - }, 24 - } 25 - 26 - local cmp_autopairs = require 'nvim-autopairs.completion.cmp' 27 - local cmp_ok, cmp = pcall(require, 'cmp') 28 - if not cmp_ok then 29 - return 30 - end 31 - cmp.event:on('confirm_done', cmp_autopairs.on_confirm_done { map_char = { tex = '' } })
-21
nvim_old/lua/plugins/bufferline.lua
··· 1 - local ok, bufferline = pcall(require, 'bufferline') 2 - if not ok then 3 - return 4 - end 5 - 6 - bufferline.setup { 7 - options = { 8 - numbers = 'none', 9 - close_command = 'bdelete! %d', 10 - max_name_length = 18, 11 - max_prefix_length = 15, 12 - tab_size = 18, 13 - diagnostics = false, -- | 'nvim_lsp' | 'coc' 14 - diagnostics_update_in_insert = false, 15 - offsets = { { filetype = 'NvimTree', text = '' } }, 16 - separator_style = 'thin', -- | 'thick' | 'slant' | { 'any', 'any' } 17 - enforce_regular_tabs = false, 18 - always_show_bufferline = true, 19 - sort_by = 'relative_directory', 20 - }, 21 - }
-134
nvim_old/lua/plugins/cmp.lua
··· 1 - local cmp_ok, cmp = pcall(require, 'cmp') 2 - if not cmp_ok then 3 - return 4 - end 5 - 6 - local snip_ok, luasnip = pcall(require, 'luasnip') 7 - if not snip_ok then 8 - return 9 - end 10 - luasnip.filetype_extend('dart', { 'flutter' }) 11 - 12 - require('luasnip/loaders/from_vscode').lazy_load() 13 - 14 - -- TODO: typescript-react component snippet 15 - -- https://www.reddit.com/r/neovim/comments/uuhk1t/feedback_on_luasniptreesitter_snippet_that_fills/?utm_source=share&utm_medium=web2x&context=3 16 - 17 - local has_words_before = function() 18 - local line, col = unpack(vim.api.nvim_win_get_cursor(0)) 19 - return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match '%s' == nil 20 - end 21 - 22 - --   פּ ﯟ   some other good icons 23 - local kind_icons = { 24 - Text = '', 25 - Method = 'm', 26 - Function = '', 27 - Constructor = '', 28 - Field = '', 29 - Variable = '', 30 - Class = '', 31 - Interface = '', 32 - Module = '', 33 - Property = '', 34 - Unit = '', 35 - Value = '', 36 - Enum = '', 37 - Keyword = '', 38 - Snippet = '', 39 - Color = '', 40 - File = '', 41 - Reference = '', 42 - Folder = '', 43 - EnumMember = '', 44 - Constant = '', 45 - Struct = '', 46 - Event = '', 47 - Operator = '', 48 - TypeParameter = '', 49 - } 50 - -- find more here: https://www.nerdfonts.com/cheat-sheet 51 - 52 - cmp.setup { 53 - snippet = { 54 - expand = function(args) 55 - luasnip.lsp_expand(args.body) -- For `luasnip` users 56 - end, 57 - }, 58 - mapping = { 59 - ['<C-k>'] = cmp.mapping(cmp.mapping.scroll_docs(-1), { 'i', 'c' }), 60 - ['<C-j>'] = cmp.mapping(cmp.mapping.scroll_docs(1), { 'i', 'c' }), 61 - ['<C-l>'] = cmp.mapping(cmp.mapping.complete(), { 'i', 'c' }), 62 - ['<C-e>'] = cmp.mapping { 63 - i = cmp.mapping.abort(), 64 - c = cmp.mapping.close(), 65 - }, 66 - -- TODO: confirm only if selected (for selecting snippets) 67 - ['<CR>'] = cmp.mapping.confirm { select = true }, 68 - ['<Tab>'] = cmp.mapping(function(fallback) 69 - if cmp.visible() then 70 - cmp.select_next_item() 71 - elseif luasnip.expand_or_jumpable() then 72 - luasnip.expand_or_jump() 73 - elseif has_words_before() then 74 - cmp.complete() 75 - else 76 - fallback() 77 - end 78 - end, { 'i', 's' }), 79 - ['<S-Tab>'] = cmp.mapping(function(fallback) 80 - if cmp.visible() then 81 - cmp.select_prev_item() 82 - elseif luasnip.jumpable(-1) then 83 - luasnip.jump(-1) 84 - else 85 - fallback() 86 - end 87 - end, { 'i', 's' }), 88 - }, 89 - formatting = { 90 - fields = { 'kind', 'abbr', 'menu' }, 91 - format = function(entry, vim_item) 92 - -- Kind icons 93 - vim_item.kind = string.format('%s', kind_icons[vim_item.kind]) 94 - -- vim_item.kind = string.format("%s %s", kind_icons[vim.item.kind], vim_item.kind) 95 - vim_item.menu = ({ 96 - nvim_lsp = '[LSP]', 97 - nvim_lua = '[VIM]', 98 - luasnip = '[Snippet]', 99 - buffer = '[Buffer]', 100 - path = '[Path]', 101 - })[entry.source.name] 102 - return vim_item 103 - end, 104 - }, 105 - sources = cmp.config.sources({ 106 - { name = 'nvim_lsp' }, 107 - { name = 'nvim_lua' }, 108 - { name = 'luasnip' }, 109 - { name = 'path' }, 110 - }, { 111 - { name = 'buffer' }, 112 - }), 113 - confirm_opts = { 114 - behavior = cmp.ConfirmBehavior.Replace, 115 - select = false, 116 - }, 117 - window = { 118 - completion = cmp.config.window.bordered(), 119 - documentation = cmp.config.window.bordered(), 120 - }, 121 - experimental = { 122 - ghost_text = false, 123 - native_menu = false, 124 - }, 125 - } 126 - 127 - cmp.setup.cmdline(':', { 128 - mapping = cmp.mapping.preset.cmdline(), 129 - sources = cmp.config.sources({ 130 - { name = 'path' } 131 - }, { 132 - { name = 'cmdline' } 133 - }) 134 - })
-40
nvim_old/lua/plugins/comment.lua
··· 1 - local ok, comment = pcall(require, 'Comment') 2 - if not ok then 3 - return 4 - end 5 - 6 - comment.setup { 7 - mappings = { 8 - basic = false, 9 - extra = false, 10 - extended = false, 11 - }, 12 - pre_hook = function(ctx) 13 - if vim.bo.filetype == 'typescriptreact' then 14 - local U = require 'Comment.utils' 15 - 16 - local location = nil 17 - if ctx.ctype == U.ctype.block then 18 - location = require('ts_context_commentstring.utils').get_cursor_location() 19 - elseif ctx.motion == U.cmotion.v or ctx.motion == U.cmotion.V then 20 - location = require('ts_context_commentstring.utils').get_visual_start_location() 21 - end 22 - 23 - return require('ts_context_commentstring.internal').calculate_commentstring { 24 - -- Determine whether to use linewise or blockwise commentstring 25 - key = ctx.ctype == U.ctype.line and '__default' or '__multiline', 26 - location = location, 27 - } 28 - end 29 - end, 30 - } 31 - 32 - -- KEYMAPS 33 - -- Linewise commnet toggle using Ctrl-/ (e.g. // some comment) 34 - -- TODO: check if `<C-/>` also works in neovim v0.7 (or `<C-_>`) 35 - vim.keymap.set('n', [[<C-/>]], require('Comment.api').toggle_current_linewise) 36 - vim.keymap.set('v', [[<C-/>]], '<Plug>(comment_toggle_linewise_visual)') 37 - 38 - -- Blockwise comment toggle using Ctrl-\ (e.g. /* some comment */) 39 - vim.keymap.set('n', [[<C-\>]], require('Comment.api').toggle_current_blockwise) 40 - vim.keymap.set('v', [[<C-\>]], '<Plug>(comment_toggle_blockwise_visual)')
-27
nvim_old/lua/plugins/diffview.lua
··· 1 - local ok, diffview = pcall(require, 'diffview') 2 - if not ok then 3 - return 4 - end 5 - 6 - local actions = require('diffview.actions') 7 - 8 - diffview.setup { 9 - keymaps = { 10 - disable_defaults = true, 11 - view = { 12 - }, 13 - file_panel = { 14 - ['j'] = actions.next_entry, 15 - ['k'] = actions.prev_entry, 16 - ['<CR>'] = actions.select_entry, 17 - }, 18 - file_history_panel = { 19 - ['j'] = actions.next_entry, 20 - ['k'] = actions.prev_entry, 21 - ['<CR>'] = actions.select_entry, 22 - ['y'] = actions.copy_hash, 23 - }, 24 - option_panel = { 25 - }, 26 - }, 27 - }
-6
nvim_old/lua/plugins/gitsigns.lua
··· 1 - local ok, gitsigns = pcall(require, 'gitsigns') 2 - if not ok then 3 - return 4 - end 5 - 6 - gitsigns.setup {}
-1
nvim_old/lua/plugins/illuminate.lua
··· 1 - vim.g.Illuminate_ftblacklist = { 'alpha', 'NvimTree', 'help', 'markdown', 'Trouble', 'toggleterm' }
-8
nvim_old/lua/plugins/inc-rename.lua
··· 1 - local ok, inc = pcall(require, 'inc_rename') 2 - if not ok then return end 3 - 4 - inc.setup{ 5 - cmd_name = 'IncRename', 6 - hl_group = 'Substitute', 7 - multifile_preview = true, 8 - }
-8
nvim_old/lua/plugins/indentblankline.lua
··· 1 - local ok, indent = pcall(require, 'indent_blankline') 2 - if not ok then return end 3 - 4 - indent.setup { 5 - -- Hide indent-blankline if tap-width is 2 6 - -- char = (vim.opt.shiftwidth:get() == 4) and '▏' or '', 7 - char = '▏', 8 - }
-25
nvim_old/lua/plugins/lualine.lua
··· 1 - local ok, lualine = pcall(require, 'lualine') 2 - if not ok then 3 - return 4 - end 5 - 6 - -- TODO: Terminal mode specific statusline 7 - -- Customizable, well-documented alternative 8 - -- : rebelot/heirline.nvim 9 - 10 - -- TODO: LSP progress message 11 - -- check : nvim-lua/lsp-status.nvim 12 - 13 - lualine.setup { 14 - options = { 15 - disabled_filetypes = { 'alpha', 'dashboard' }, 16 - globalstatus = true, 17 - }, 18 - sections = { 19 - lualine_x = { 20 - 'encoding', 21 - { 'fileformat', icons_enabled = false }, 22 - 'filetype', 23 - }, 24 - }, 25 - }
-8
nvim_old/lua/plugins/neogit.lua
··· 1 - local ok, neogit = pcall(require, 'neogit') 2 - if not ok then return end 3 - 4 - neogit.setup { 5 - integrations = { 6 - diffview = true, 7 - }, 8 - }
-10
nvim_old/lua/plugins/neorg.lua
··· 1 - local ok, neorg = pcall(require, 'neorg') 2 - if not ok then return end 3 - 4 - neorg.setup { 5 - load = { 6 - ['core.defaults'] = {}, 7 - ['core.norg.concealer'] = {}, 8 - ['core.norg.completion'] = {}, 9 - } 10 - }
-42
nvim_old/lua/plugins/notify.lua
··· 1 - local ok, notify = pcall(require, 'notify') 2 - if not ok then 3 - return 4 - end 5 - 6 - local renderers = require('notify.render') 7 - 8 - notify.setup { 9 - background_colour = 'NormalFloat', 10 - fps = 30, 11 - icons = { 12 - DEBUG = '', 13 - ERROR = '', 14 - INFO = '', 15 - TRACE = '✎', 16 - WARN = '' 17 - }, 18 - level = 2, 19 - minimum_width = 50, 20 - max_width = 70, 21 - render = function(bufnr, notif, highlights, config) 22 - if notif.title[1] == '' then 23 - return renderers.minimal(bufnr, notif, highlights, config) 24 - else 25 - return renderers.default(bufnr, notif, highlights, config) 26 - end 27 - end, 28 - stages = 'fade_in_slide_out', 29 - timeout = 1500, 30 - } 31 - 32 - -- KEYMAPS 33 - -- clear all 34 - vim.keymap.set('n', '-', function() 35 - require('notify').dismiss() -- dismiss notifications 36 - vim.cmd([[noh]]) -- remove search highlights 37 - vim.cmd([[echon]]) -- clear cmdline 38 - end) 39 - -- show past notifications 40 - vim.keymap.set('n', '+', '<cmd>Notifications<CR>') 41 - 42 - vim.notify = notify
-127
nvim_old/lua/plugins/nvim-tree.lua
··· 1 - local ok, nvim_tree = pcall(require, 'nvim-tree') 2 - if not ok then 3 - return 4 - end 5 - 6 - -- NOTE: tree_cb & the cb property are deprecated. See `:help nvim-tree-mappings` 7 - -- local config_ok, nvim_tree_config = pcall(require, 'nvim-tree.config') 8 - -- if not config_ok then 9 - -- return 10 - -- end 11 - -- 12 - -- local tree_cb = nvim_tree_config.nvim_tree_callback 13 - 14 - -- TODO: Update this with original github setup {} code 15 - nvim_tree.setup { 16 - disable_netrw = true, 17 - hijack_cursor = false, 18 - hijack_netrw = true, 19 - open_on_setup = false, 20 - ignore_ft_on_setup = { 21 - 'startify', 22 - 'dashboard', 23 - 'alpha', 24 - }, 25 - open_on_tab = false, 26 - update_cwd = true, 27 - view = { 28 - -- TODO: function to calculate suitable width (open on current window in small width) 29 - width = 30, 30 - height = 30, 31 - hide_root_folder = false, 32 - side = 'left', 33 - mappings = { 34 - custom_only = true, 35 - list = { 36 - -- KEMAPS 37 - { key = { 'l', '<CR>' }, action = 'edit' }, 38 - { key = 'e', action = 'edit_in_place' }, 39 - { key = 'h', action = 'close_node' }, 40 - { key = 'v', action = 'vsplit' }, 41 - { key = '0', action = 'first_sibling' }, 42 - { key = '$', action = 'last_sibling' }, 43 - { key = 'I', action = 'toggle_git_ignored' }, 44 - { key = 'H', action = 'toggle_dotfiles' }, 45 - { key = 'U', action = 'toggle_custom' }, 46 - { key = 'R', action = 'refresh' }, 47 - { key = 'a', action = 'create' }, 48 - { key = 'd', action = 'remove' }, 49 - { key = 'D', action = 'trash' }, 50 - { key = 'r', action = 'rename' }, 51 - { key = '<C-r>', action = 'full_rename' }, 52 - { key = 'x', action = 'cut' }, 53 - { key = 'c', action = 'copy' }, 54 - { key = 'p', action = 'paste' }, 55 - { key = 'y', action = 'copy_name' }, 56 - { key = 'Y', action = 'copy_path' }, 57 - { key = 'gy', action = 'copy_absolute_path' }, 58 - { key = '?', action = 'toggle_help' }, 59 - }, 60 - }, 61 - number = false, 62 - relativenumber = false, 63 - }, 64 - renderer = { 65 - icons = { 66 - glyphs = { 67 - default = '', 68 - symlink = '', 69 - folder = { 70 - arrow_closed = '', 71 - arrow_open = '', 72 - default = '', 73 - open = '', 74 - empty = '', 75 - empty_open = '', 76 - symlink = '', 77 - symlink_open = '', 78 - }, 79 - git = { 80 - unstaged = 'U', 81 - staged = '+', 82 - unmerged = '', 83 - renamed = '➜', 84 - untracked = '?', 85 - deleted = '', 86 - ignored = '◌', 87 - }, 88 - } 89 - } 90 - }, 91 - diagnostics = { 92 - enable = true, 93 - icons = { 94 - hint = '', 95 - info = '', 96 - warning = '', 97 - error = '', 98 - }, 99 - }, 100 - update_focused_file = { 101 - enable = true, 102 - update_cwd = false, 103 - ignore_list = {}, 104 - }, 105 - system_open = { 106 - cmd = nil, 107 - args = {}, 108 - }, 109 - filters = { 110 - dotfiles = false, 111 - custom = {}, 112 - }, 113 - git = { 114 - enable = true, 115 - ignore = true, 116 - timeout = 400, 117 - }, 118 - trash = { 119 - cmd = 'trash', 120 - require_confirm = true, 121 - }, 122 - actions = { 123 - open_file = { 124 - quit_on_open = false, 125 - }, 126 - }, 127 - }
-11
nvim_old/lua/plugins/project.lua
··· 1 - local ok, project = pcall(require, 'project_nvim') 2 - if not ok then return end 3 - 4 - project.setup { 5 - patterns = { '.git', 'README.md', '_darcs', '.hg', '.bzr', '.svn', 'Makefile', 'package.json' }, 6 - } 7 - 8 - local tel_ok, telescope = pcall(require, 'telescope') 9 - if not tel_ok then return end 10 - 11 - telescope.load_extension('projects')
-19
nvim_old/lua/plugins/telescope.lua
··· 1 - local ok, telescope = pcall(require, 'telescope') 2 - if not ok then 3 - return 4 - end 5 - 6 - local actions = require 'telescope.actions' 7 - 8 - telescope.setup { 9 - defaults = { 10 - mappings = { 11 - i = { 12 - ['<C-j>'] = actions.move_selection_next, 13 - ['<C-k>'] = actions.move_selection_previous, 14 - ['<ESC>'] = actions.close, 15 - ['<C-c>'] = actions.close, 16 - } 17 - } 18 - }, 19 - }
-5
nvim_old/lua/plugins/todo-comments.lua
··· 1 - local ok, todo = pcall(require, 'todo-comments') 2 - if not ok then return end 3 - 4 - todo.setup({ 5 - })
-65
nvim_old/lua/plugins/toggleterm.lua
··· 1 - local ok, toggleterm = pcall(require, 'toggleterm') 2 - if not ok then 3 - return 4 - end 5 - 6 - local Terminal = require('toggleterm.terminal').Terminal 7 - 8 - function _Lazygit_toggle() 9 - local lazygit = Terminal:new({ 10 - cmd = 'lazygit', 11 - hidden = true, -- whether or not to include this terminal in the terminals list 12 - dir = 'git_dir', 13 - direction = 'tab', 14 - on_open = function() 15 - -- Don't use general on_open function defined below 16 - end, 17 - }) 18 - lazygit:toggle() 19 - end 20 - 21 - local files = { 22 - c = { 'gcc -o temp ', ' && ./temp && rm ./temp' }, 23 - cpp = { 'g++ -o temp ', ' && ./temp && rm ./temp' }, 24 - } 25 - local function Runfile() 26 - -- vim.cmd [[w]] 27 - local cmds = files[vim.bo.filetype] 28 - local command = cmds[1] .. vim.fn.expand('%:t') .. cmds[2] 29 - if command ~= nil then 30 - Terminal 31 - :new({ cmd = command, close_on_exit = false }) 32 - :toggle() 33 - print('Running: ' .. command) 34 - end 35 - end 36 - 37 - -- KEYMAPS 38 - vim.keymap.set('n', '<leader><leader>r', Runfile) 39 - vim.keymap.set('n', '<F11>', Runfile) 40 - 41 - toggleterm.setup { 42 - size = function(term) 43 - if term.direction == 'horizontal' then 44 - return 15 45 - elseif term.direction == 'vertical' then 46 - return vim.o.columns * 0.4 47 - end 48 - end, 49 - open_mapping = [[<c-t>]], 50 - on_open = function(term) 51 - local opts = { buffer = term.bufnr } 52 - vim.wo.signcolumn = 'no' 53 - -- KEYMAPS 54 - -- Fast enter NORMAL mode 55 - vim.keymap.set('t', '<ESC>', [[<C-\><C-n>]], opts) 56 - vim.keymap.set('t', 'jk', [[<C-\><C-n>]], opts) 57 - end, 58 - start_in_insert = false, 59 - insert_mappings = false, 60 - float_opts = { 61 - border = 'curved', 62 - }, 63 - } 64 - 65 - -- vim.api.nvim_del_user_command('TermExec')
-39
nvim_old/lua/plugins/treesitter/context.lua
··· 1 - local ok, context = pcall(require, 'treesitter-context') 2 - if not ok then return end 3 - 4 - context.setup { 5 - enable = false, -- Enable this plugin (Can be enabled/disabled later via commands) 6 - max_lines = 0, -- How many lines the window should span. Values <= 0 mean no limit. 7 - patterns = { -- Match patterns for TS nodes. These get wrapped to match at word boundaries. 8 - -- For all filetypes 9 - -- Note that setting an entry here replaces all other patterns for this entry. 10 - -- By setting the 'default' entry below, you can control which nodes you want to 11 - -- appear in the context window. 12 - default = { 13 - 'class', 14 - 'function', 15 - 'method', 16 - -- 'for', -- These won't appear in the context 17 - -- 'while', 18 - -- 'if', 19 - -- 'switch', 20 - -- 'case', 21 - }, 22 - -- Example for a specific filetype. 23 - -- If a pattern is missing, *open a PR* so everyone can benefit. 24 - -- rust = { 25 - -- 'impl_item', 26 - -- }, 27 - }, 28 - exact_patterns = { 29 - -- Example for a specific filetype with Lua patterns 30 - -- Treat patterns.rust as a Lua pattern (i.e "^impl_item$" will 31 - -- exactly match "impl_item" only) 32 - -- rust = true, 33 - }, 34 - 35 - -- [!] The options below are exposed but shouldn't require your attention, 36 - -- you can safely ignore them. 37 - 38 - zindex = 20, -- The Z-index of the context window 39 - }
-91
nvim_old/lua/plugins/treesitter/init.lua
··· 1 - local ok, tsconfigs = pcall(require, 'nvim-treesitter.configs') 2 - if not ok then 3 - return 4 - end 5 - 6 - local loved_parsers = require('plugins.treesitter.parsers') 7 - 8 - tsconfigs.setup { 9 - -- A list of parser names, or "all" 10 - ensure_installed = loved_parsers, 11 - 12 - -- Install languages synchronously (only applied to `ensure_installed`) 13 - sync_install = false, 14 - 15 - -- List of parsers to ignore installing (for "all") 16 - ignore_install = false, 17 - -- ignore_install = { "d", "foam", "help", "phpdoc", "slint", "todotxt", "verilog" }, 18 - 19 - highlight = { 20 - -- `false` will disable the whole extension 21 - enable = true, 22 - 23 - -- NOTE: these are the names of the parsers and not the filetype. (for example if you want to 24 - -- disable highlighting for the `tex` filetype, you need to include `latex` in this list as this is 25 - -- the name of the parser) 26 - -- list of language that will be diagnostic_disabled 27 - disable = {}, 28 - 29 - -- Setting this to true will run `:h syntax` and tree-sitter at the same time. 30 - -- Set this to `true` if you depend on 'syntax' being enabled (like for indentation). 31 - -- Using this option may slow down your editor, and you may see some duplicate highlights. 32 - -- Instead of true it can also be a list of languages 33 - additional_vim_regex_highlighting = true, 34 - }, 35 - 36 - autopairs = { 37 - enable = true, 38 - }, 39 - autotag = { 40 - enable = true, 41 - }, 42 - indent = { enable = true, disable = { 'yaml' } }, 43 - textobjects = { 44 - select = { 45 - enable = true, 46 - 47 - -- Automatically jump forward to textobj, similar to targets.vim 48 - lookahead = true, 49 - 50 - keymaps = { 51 - ['af'] = '@function.outer', 52 - ['if'] = '@function.inner', 53 - ['i0'] = '@parameter.inner', 54 - ['ac'] = '@class.outer', 55 - ['ic'] = '@class.outer', 56 - }, 57 - }, 58 - move = { 59 - enable = true, 60 - set_jumps = true, -- whether to set jumps in the jumplist 61 - goto_next_start = { 62 - [']f'] = '@function.inner', 63 - [']p'] = '@parameter.inner', 64 - ['<leader>p'] = '@parameter.inner', 65 - [']c'] = '@class.inner', 66 - }, 67 - goto_next_end = { 68 - [']e'] = '@parameter.inner', 69 - }, 70 - goto_previous_start = { 71 - ['[f'] = '@function.inner', 72 - ['[p'] = '@parameter.inner', 73 - ['[c'] = '@class.inner', 74 - }, 75 - goto_previous_end = { 76 - ['[e'] = '@parameter.inner', 77 - }, 78 - }, 79 - }, 80 - context_commentstring = { 81 - enable = true, 82 - enable_autocmd = false, 83 - }, 84 - } 85 - -- KEYMAPS 86 - vim.keymap.set('n', ')', ']p', { remap = true }) 87 - vim.keymap.set('n', '(', '[p', { remap = true }) 88 - vim.keymap.set({ 'n', 'v' }, '<leader>0', '<ESC>]pvi0', { remap = true }) 89 - vim.keymap.set({ 'n', 'v' }, '<leader>9', '<ESC>[evi0', { remap = true }) 90 - 91 - require 'plugins.treesitter.context'
-34
nvim_old/lua/plugins/treesitter/parsers.lua
··· 1 - return { 2 - 'bash', 3 - 'c', 4 - 'c_sharp', 5 - 'comment', 6 - 'cpp', 7 - 'css', 8 - 'dart', 9 - 'dockerfile', 10 - 'fish', 11 - 'go', 12 - 'gomod', 13 - 'html', 14 - 'javascript', 15 - 'json', 16 - 'lua', 17 - 'markdown', 18 - 'markdown_inline', 19 - 'php', 20 - 'python', 21 - 'pug', 22 - 'ruby', 23 - 'rust', 24 - 'scss', 25 - 'solidity', 26 - 'svelte', 27 - 'swift', 28 - 'toml', 29 - 'tsx', 30 - 'typescript', 31 - 'vim', 32 - 'vue', 33 - 'yaml', 34 - }
-5
nvim_old/lua/plugins/trouble.lua
··· 1 - local ok, trouble = pcall(require, 'trouble') 2 - if not ok then return end 3 - 4 - trouble.setup { 5 - }
-120
nvim_old/lua/plugins/whichkey.lua
··· 1 - local status_ok, which_key = pcall(require, 'which-key') 2 - if not status_ok then return end 3 - 4 - which_key.setup({ 5 - plugins = { 6 - presets = { 7 - operators = true, 8 - motions = false, 9 - text_objects = false, 10 - windows = false, 11 - nav = false, 12 - z = true, 13 - g = false, 14 - }, 15 - }, 16 - key_labels = { 17 - ['<leader>'] = 'SPC', 18 - }, 19 - layout = { 20 - height = { min = 4, max = 25 }, -- min and max height of the columns 21 - width = { min = 20, max = 50 }, -- min and max width of the columns 22 - spacing = 4, -- spacing between columns 23 - align = 'left', -- align columns left, center or right 24 - }, 25 - ignore_missing = true, 26 - }) 27 - 28 - local default_opts = { 29 - mode = 'n', 30 - prefix = '<leader>', 31 - buffer = nil, 32 - silent = true, 33 - noremap = true, 34 - nowait = true, 35 - } 36 - 37 - local function newopts(...) 38 - return vim.tbl_deep_extend('force', default_opts, ...) 39 - end 40 - 41 - local mappings = { 42 - ['0'] = { 'Select Next Parameter' }, 43 - ['9'] = { 'Select Prev Parameter' }, 44 - [';'] = { '<cmd>Telescope commands<CR>', 'Commands' }, 45 - 46 - a = { '<cmd>Alpha<CR>', 'Alpha' }, 47 - b = { '<cmd>Telescope buffers<CR>', 'Buffers' }, 48 - f = { 49 - name = 'File', 50 - f = { '<cmd>Telescope find_files<CR>', 'Find in CWD' }, 51 - g = { '<cmd>Telescope live_grep<CR>', 'Live Grep' }, 52 - l = { '<cmd>NvimTreeToggle<CR>', 'Toggle NvimTree' }, 53 - r = { '<cmd>Telescope oldfiles<CR>', 'Recent' }, 54 - }, 55 - g = { 56 - name = 'Git', 57 - -- TODO: add way to go-to-next-git-block 58 - j = { '<cmd>Gitsigns next_hunk<CR>', 'Go To Next Hunk' }, 59 - k = { '<cmd>Gitsigns prev_hunk<CR>', 'Go To Prev Hunk' }, 60 - s = { '<cmd>Telescope git_status<CR>', 'Status' }, 61 - d = { '<cmd>DiffviewOpen<CR>', 'Diff view' }, 62 - l = { '<cmd>lua _Lazygit_toggle()<CR>', 'LazyGit' }, 63 - }, 64 - h = { '<cmd>Telescope help_tags<CR>', ':help' }, 65 - l = { 66 - name = 'Lsp', 67 - a = { '<cmd>lua vim.lsp.buf.code_action()<CR>', 'Code Action' }, 68 - d = { '<cmd>lua vim.lsp.buf.definition()<CR>', 'Definition' }, 69 - D = { '<cmd>lua vim.lsp.buf.declaration()<CR>', 'Declaration' }, 70 - f = { '<cmd>lua vim.lsp.buf.format()<CR>', 'Format this file' }, 71 - F = { "<cmd>lua require('core.lsp.handlers').toggle_format_on_save()<CR>", 'Toggle AutoFormat' }, 72 - I = { '<cmd>LspInstallInfo<CR>', 'Installer Info' }, 73 - i = { '<cmd>LspInfo<CR>', 'Info' }, 74 - j = { 75 - '<cmd>lua vim.diagnostic.goto_next()<CR>', 76 - 'Next Diagnostic', 77 - }, 78 - k = { 79 - '<cmd>lua vim.diagnostic.goto_prev()<CR>', 80 - 'Prev Diagnostic', 81 - }, 82 - r = { vim.lsp.buf.rename, 'Rename' }, 83 - w = { '<cmd>TroubleToggle workspace_diagnostics<CR>', 'Workspace Diagnostics' }, 84 - }, 85 - q = { '<cmd>close<CR>', 'Close Window' }, 86 - ['<leader>'] = { 87 - name = 'Terminal', 88 - ['1'] = { '<cmd>1ToggleTerm<CR>', '1' }, 89 - ['2'] = { '<cmd>2ToggleTerm<CR>', '2' }, 90 - ['3'] = { '<cmd>3ToggleTerm<CR>', '3' }, 91 - ['4'] = { '<cmd>4ToggleTerm<CR>', '4' }, 92 - f = { '<cmd>ToggleTerm direction=float<CR>', 'Float Terminal' }, 93 - }, 94 - -- TODO: delete buffer if bufnr(0) is -1 or it is last window(except NvimTree, Trouble, ...) istead of closing window 95 - q = { 'Close Window' }, 96 - t = { 97 - name = 'Trouble', 98 - w = { '<cmd>TroubleToggle workspace_diagnostics<CR>', 'Workspace Diagnostics' }, 99 - r = { '<cmd>TroubleToggle lsp_references<CR>', 'LSP References' }, 100 - -- d = { '<cmd>TroubleToggle lsp_definitions<CR>', 'LSP Definitions' }, 101 - q = { '<cmd>TroubleToggle quickfix<CR>', 'Quickfix Items' }, 102 - l = { '<cmd>TroubleToggle loclist<CR>', 'Location List' }, 103 - t = { '<cmd>TodoTrouble<CR>', 'Todo List' }, 104 - }, 105 - } 106 - 107 - local term_opts_n = newopts({ prefix = [[<C-;>]] }) 108 - 109 - -- TODO: avoid `"+` typing in terminal-mode 110 - local term_mappings = { 111 - ['1'] = { '<cmd>1ToggleTerm<CR>', 'Terminal id : 1' }, 112 - ['2'] = { '<cmd>2ToggleTerm<CR>', 'Terminal id : 2' }, 113 - ['3'] = { '<cmd>3ToggleTerm<CR>', 'Terminal id : 3' }, 114 - ['4'] = { '<cmd>4ToggleTerm<CR>', 'Terminal id : 4' }, 115 - a = { '<cmd>ToggleTermToggleAll<CR>', 'Toggle All Terminals' }, 116 - f = { '<cmd>5ToggleTerm direction=float<CR>', 'Float Terminal' }, 117 - } 118 - 119 - which_key.register(mappings, default_opts) 120 - which_key.register(term_mappings, term_opts_n)
-71
nvim_old/lua/ui/winbar.lua
··· 1 - -- use nvim-gps if lsp['documentSymbols'] is not supported 2 - local M = {} 3 - 4 - local n_ok, navic = pcall(require, 'nvim-navic') 5 - if n_ok then 6 - navic.setup { 7 - highlight = true, 8 - separator = ' > ', 9 - } 10 - end 11 - 12 - local n_gps = require 'nvim-gps' 13 - n_gps.setup() 14 - 15 - ---filename with icon based on filetype 16 - M.filename = function() 17 - local filename = vim.fn.expand('%:t') 18 - local extension = vim.fn.expand('%:e') 19 - 20 - if filename == '' then 21 - return 22 - end 23 - 24 - local ok, devicons = pcall(require, 'nvim-web-devicons') 25 - if not ok then 26 - return 27 - end 28 - extension = extension ~= '' and extension or vim.bo.filetype 29 - local ft_icon, ft_icon_hl_group = devicons.get_icon(filename, extension, { default = true }) 30 - return ' ' .. '%#' .. ft_icon_hl_group .. '#' .. ft_icon .. '%* %#CursorLineNr#' .. filename .. '%*' 31 - end 32 - 33 - M.gps = function() 34 - if navic.is_available() then 35 - -- vim.schedule(function() 36 - -- vim.notify('use navic') 37 - -- end) 38 - return navic.get_location() 39 - elseif n_gps.is_available() then 40 - -- vim.schedule(function() 41 - -- vim.notify('use gps') 42 - -- end) 43 - return n_gps.get_location() 44 - end 45 - end 46 - 47 - M.filetype_exclude = { 48 - 'alpha', 49 - 'help', 50 - 'NvimTree', 51 - 'neogitstatus', 52 - 'packer', 53 - 'Trouble', 54 - 'Telescope', 55 - 'Whichkey', 56 - } 57 - 58 - M.get_winbar = function() 59 - if vim.bo.buftype == 'terminal' then 60 - return '' 61 - end 62 - if vim.tbl_contains(M.filetype_exclude, vim.bo.filetype) then 63 - return '' 64 - end 65 - return table.concat({ 66 - M.filename(), 67 - M.gps(), 68 - }, ' %#LineNr#' .. '>' .. '%* ') 69 - end 70 - 71 - return M