From e25677cbebfa2a9e4705de3d47610cd2026d0b56 Mon Sep 17 00:00:00 2001 From: Joe Date: Fri, 22 Sep 2023 11:20:53 +0200 Subject: up --- .config/nvim/after/plugin/asyncomplete.lua | 13 + .config/nvim/after/plugin/floaterm.lua | 9 + .config/nvim/after/plugin/lualine.lua | 349 +++++++++++++++++++++++ .config/nvim/after/plugin/nerd-commenter.lua | 14 + .config/nvim/after/plugin/org.lua | 4 + .config/nvim/after/plugin/quickscope.lua | 7 + .config/nvim/after/plugin/rainbow.lua | 23 ++ .config/nvim/after/plugin/signify.lua | 1 + .config/nvim/after/plugin/startify.lua | 29 ++ .config/nvim/after/plugin/treesitter.lua | 34 +++ .config/nvim/after/plugin/whichkey.lua | 56 ++++ .config/nvim/init.lua | 22 +- .config/nvim/lua/plugs-config/asyncomplete.lua | 13 - .config/nvim/lua/plugs-config/floaterm.lua | 9 - .config/nvim/lua/plugs-config/lualine.lua | 349 ----------------------- .config/nvim/lua/plugs-config/nerd-commenter.lua | 14 - .config/nvim/lua/plugs-config/org.lua | 4 - .config/nvim/lua/plugs-config/quickscope.lua | 7 - .config/nvim/lua/plugs-config/rainbow.lua | 23 -- .config/nvim/lua/plugs-config/signify.lua | 1 - .config/nvim/lua/plugs-config/startify.lua | 29 -- .config/nvim/lua/plugs-config/treesitter.lua | 34 --- .config/nvim/lua/plugs-config/whichkey.lua | 43 --- .config/nvim/plug-config/vim-lsp.vim | 78 ++--- 24 files changed, 589 insertions(+), 576 deletions(-) create mode 100644 .config/nvim/after/plugin/asyncomplete.lua create mode 100644 .config/nvim/after/plugin/floaterm.lua create mode 100644 .config/nvim/after/plugin/lualine.lua create mode 100644 .config/nvim/after/plugin/nerd-commenter.lua create mode 100644 .config/nvim/after/plugin/org.lua create mode 100644 .config/nvim/after/plugin/quickscope.lua create mode 100644 .config/nvim/after/plugin/rainbow.lua create mode 100644 .config/nvim/after/plugin/signify.lua create mode 100644 .config/nvim/after/plugin/startify.lua create mode 100644 .config/nvim/after/plugin/treesitter.lua create mode 100644 .config/nvim/after/plugin/whichkey.lua delete mode 100644 .config/nvim/lua/plugs-config/asyncomplete.lua delete mode 100644 .config/nvim/lua/plugs-config/floaterm.lua delete mode 100644 .config/nvim/lua/plugs-config/lualine.lua delete mode 100644 .config/nvim/lua/plugs-config/nerd-commenter.lua delete mode 100644 .config/nvim/lua/plugs-config/org.lua delete mode 100644 .config/nvim/lua/plugs-config/quickscope.lua delete mode 100644 .config/nvim/lua/plugs-config/rainbow.lua delete mode 100644 .config/nvim/lua/plugs-config/signify.lua delete mode 100644 .config/nvim/lua/plugs-config/startify.lua delete mode 100644 .config/nvim/lua/plugs-config/treesitter.lua delete mode 100644 .config/nvim/lua/plugs-config/whichkey.lua (limited to '.config/nvim') diff --git a/.config/nvim/after/plugin/asyncomplete.lua b/.config/nvim/after/plugin/asyncomplete.lua new file mode 100644 index 0000000..da28c37 --- /dev/null +++ b/.config/nvim/after/plugin/asyncomplete.lua @@ -0,0 +1,13 @@ +vim.cmd [[ +autocmd User asyncomplete_setup call asyncomplete#register_source( + \ asyncomplete#sources#clang#get_source_options({ + \ 'config': { + \ 'clang_path': '/usr/bin/cc', + \ 'clang_args': { + \ 'default': ['-I/usr/include'], + \ 'c': ['-std=c89', '-I/usr/include'], + \ 'cpp': ['-std=c++98', '-I/usr/include'] + \ } + \ } + \ })) +]] diff --git a/.config/nvim/after/plugin/floaterm.lua b/.config/nvim/after/plugin/floaterm.lua new file mode 100644 index 0000000..7f80d65 --- /dev/null +++ b/.config/nvim/after/plugin/floaterm.lua @@ -0,0 +1,9 @@ +vim.g.floaterm_autoinsert = 1 +vim.g.floaterm_width = 0.6 +vim.g.floaterm_height = 0.45 +vim.g.floaterm_wintitle = 0 +vim.g.floaterm_autoclose = 1 +vim.g.floaterm_position = 'bottom' +vim.g.floaterm_gitcommit = 'split' +vim.g.floaterm_wintype = 'floating' +vim.g.floaterm_rootmarkers = { '.project', '.git', '.hg', '.svn', '.root', '.gitignore', '.fslckout', '.fossil-settings' } diff --git a/.config/nvim/after/plugin/lualine.lua b/.config/nvim/after/plugin/lualine.lua new file mode 100644 index 0000000..f3d2fe7 --- /dev/null +++ b/.config/nvim/after/plugin/lualine.lua @@ -0,0 +1,349 @@ +-- Eviline config for lualine +-- Author: shadmansaleh +-- Credit: glepnir +local lualine = require('lualine') + +-- Color table for highlights +-- stylua: ignore +local colors = { + bg = '#202328', + fg = '#bbc2cf', + yellow = '#ECBE7B', + cyan = '#008080', + darkblue = '#081633', + green = '#98be65', + orange = '#FF8800', + violet = '#a9a1e1', + magenta = '#c678dd', + blue = '#51afef', + red = '#ec5f67', +} + +local conditions = { + buffer_not_empty = function() + return vim.fn.empty(vim.fn.expand('%:t')) ~= 1 + end, + hide_in_width = function() + return vim.fn.winwidth(0) > 80 + end, + check_git_workspace = function() + local filepath = vim.fn.expand('%:p:h') + local gitdir = vim.fn.finddir('.git', filepath .. ';') + return gitdir and #gitdir > 0 and #gitdir < #filepath + end, +} + +-- Config +local config = { + options = { + -- Disable sections and component separators + component_separators = '', + section_separators = '', + theme = { + -- We are going to use lualine_c an lualine_x as left and + -- right section. Both are highlighted by c theme . So we + -- are just setting default looks o statusline + normal = { c = { fg = colors.fg, bg = colors.bg } }, + inactive = { c = { fg = colors.fg, bg = colors.bg } }, + }, + }, + sections = { + -- these are to remove the defaults + lualine_a = {}, + lualine_b = {}, + lualine_y = {}, + lualine_z = {}, + -- These will be filled later + lualine_c = {}, + lualine_x = {}, + }, + inactive_sections = { + -- these are to remove the defaults + lualine_a = {}, + lualine_b = {}, + lualine_y = {}, + lualine_z = {}, + lualine_c = {}, + lualine_x = {}, + }, +} + +-- Inserts a component in lualine_c at left section +local function ins_left(component) + table.insert(config.sections.lualine_c, component) +end + +-- Inserts a component in lualine_x at right section +local function ins_right(component) + table.insert(config.sections.lualine_x, component) +end + +ins_left { + function() + return '▊' + end, + -- color = { fg = colors.green }, -- Sets highlighting of component + color = function() + -- auto change color according to neovims mode + local mode_color = { + n = colors.green, + i = colors.blue, + v = colors.magenta, + [''] = colors.magenta, + V = colors.magenta, + c = colors.yellow, + no = colors.red, + s = colors.orange, + S = colors.orange, + [''] = colors.orange, + ic = colors.yellow, + R = colors.red, + Rv = colors.violet, + cv = colors.red, + ce = colors.red, + r = colors.cyan, + rm = colors.cyan, + ['r?'] = colors.cyan, + ['!'] = colors.red, + t = colors.red, + } + return { fg = mode_color[vim.fn.mode()] } + end, + padding = { left = 0, right = 1 }, -- We don't need space before this +} + +ins_left { + -- mode component + function() + return '' + end, + color = function() + -- auto change color according to neovims mode + local mode_color = { + n = colors.green, + i = colors.blue, + v = colors.magenta, + [''] = colors.magenta, + V = colors.magenta, + c = colors.yellow, + no = colors.red, + s = colors.orange, + S = colors.orange, + [''] = colors.orange, + ic = colors.yellow, + R = colors.red, + Rv = colors.violet, + cv = colors.red, + ce = colors.red, + r = colors.cyan, + rm = colors.cyan, + ['r?'] = colors.cyan, + ['!'] = colors.red, + t = colors.red, + } + return { fg = mode_color[vim.fn.mode()] } + end, + padding = { right = 1 }, +} + +-- ins_left { +-- 'filename', +-- cond = conditions.buffer_not_empty, +-- color = { fg = colors.magenta, gui = 'bold' }, +-- } + +ins_left { + 'buffers', + show_filename_only = false, + hide_filename_extension = false, + show_modified_status = true, + icons_enabled = true, + symbols = { + modified = ' ●', -- Text to show when the buffer is modified + alternate_file = '', -- Text to show to identify the alternate file + directory = '', -- Text to show when the buffer is a directory + }, + buffers_color = { + -- Same values as the general color option can be used here. + active = function() + -- auto change color according to neovims mode + local mode_color = { + n = colors.green, + i = colors.blue, + v = colors.magenta, + [''] = colors.magenta, + V = colors.magenta, + c = colors.yellow, + no = colors.red, + s = colors.orange, + S = colors.orange, + [''] = colors.orange, + ic = colors.yellow, + R = colors.red, + Rv = colors.violet, + cv = colors.red, + ce = colors.red, + r = colors.cyan, + rm = colors.cyan, + ['r?'] = colors.cyan, + ['!'] = colors.red, + t = colors.red, + } + return { fg = mode_color[vim.fn.mode()], gui = 'bold' } + end, + }, +} + +ins_left { + 'diagnostics', + sources = { 'nvim_diagnostic' }, + symbols = { error = ' ', warn = ' ', info = ' ' }, + diagnostics_color = { + color_error = { fg = colors.red }, + color_warn = { fg = colors.yellow }, + color_info = { fg = colors.cyan }, + }, +} + +-- Insert mid section. You can make any number of sections in neovim :) +-- for lualine it's any number greater then 2 +-- ins_left { +-- function() +-- return '%=' +-- end, +-- } + +ins_right { + 'filetype', + icons_enabled = true, -- I think icons are cool but Eviline doesn't have them. sigh + color = { fg = colors.blue }, +} + +ins_right { + -- Lsp server name . + function() + local msg = 'no lsp' + local buf_ft = vim.api.nvim_buf_get_option(0, 'filetype') + local clients = vim.lsp.get_active_clients() + if next(clients) == nil then + -- icon = '' + return + end + for _, client in ipairs(clients) do + local filetypes = client.config.filetypes + if filetypes and vim.fn.index(filetypes, buf_ft) ~= -1 then + return client.name + end + end + return msg + end, + icon = ' ', + color = { fg = colors.cyan }, +} + +ins_right { + 'branch', + icon = '', + color = { fg = colors.violet, gui = 'bold' }, +} + +ins_right { + -- filesize component + 'filesize', + cond = conditions.buffer_not_empty, +} + +ins_right { + 'diff', + -- Is it me or the symbol for modified us really weird + symbols = { added = ' ', modified = '󰝤 ', removed = ' ' }, + diff_color = { + added = { fg = colors.green }, + modified = { fg = colors.orange }, + removed = { fg = colors.red }, + }, + cond = conditions.hide_in_width, +} + +ins_right { 'location' } + +ins_right { + function() + return '▊' + end, + -- color = { fg = colors.green }, + color = function() + -- auto change color according to neovims mode + local mode_color = { + n = colors.green, + i = colors.blue, + v = colors.magenta, + [''] = colors.magenta, + V = colors.magenta, + c = colors.yellow, + no = colors.red, + s = colors.orange, + S = colors.orange, + [''] = colors.orange, + ic = colors.yellow, + R = colors.red, + Rv = colors.violet, + cv = colors.red, + ce = colors.red, + r = colors.cyan, + rm = colors.cyan, + ['r?'] = colors.cyan, + ['!'] = colors.red, + t = colors.red, + } + return { fg = mode_color[vim.fn.mode()] } + end, + padding = { left = 1 }, +} + +-- Now don't forget to initialize lualine +lualine.setup(config) + + + + +-- require('lualine').setup { +-- options = { +-- icons_enabled = true, +-- theme = 'gruvbox', +-- section_separators = { left = '', right = '' }, +-- component_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 = { 'buffers' }, +-- lualine_y = { 'filetype' }, +-- lualine_z = { 'location' } +-- }, +-- inactive_sections = { +-- lualine_a = {}, +-- lualine_b = {}, +-- lualine_c = { 'filename' }, +-- lualine_x = {}, +-- lualine_y = {}, +-- lualine_z = {} +-- }, +-- tabline = {}, +-- winbar = {}, +-- inactive_winbar = {}, +-- extensions = {}, +-- } diff --git a/.config/nvim/after/plugin/nerd-commenter.lua b/.config/nvim/after/plugin/nerd-commenter.lua new file mode 100644 index 0000000..ddfadf2 --- /dev/null +++ b/.config/nvim/after/plugin/nerd-commenter.lua @@ -0,0 +1,14 @@ +-- NERD Commenter +vim.g.NERDSpaceDelims = 1 +vim.g.NERDCompactSexyComs = 1 +vim.g.NERDDefaultAlign = 'left' +vim.g.NERDAltDelims_java = 1 +vim.g.NERDCustomDelimiters = { + c = { + left = '/*', + right = '*/', + } +} +vim.g.NERDCommentEmptyLines = 1 +vim.g.NERDTrimTrailingWhitespace = 1 +vim.g.NERDToggleCheckAllLines = 1 diff --git a/.config/nvim/after/plugin/org.lua b/.config/nvim/after/plugin/org.lua new file mode 100644 index 0000000..662ad08 --- /dev/null +++ b/.config/nvim/after/plugin/org.lua @@ -0,0 +1,4 @@ +-- Org-mode +vim.g.org_todo_keywords = { 'TODO', '|', 'DONE', 'CANCELED' } +vim.g.org_export_emacs = "/usr/bin/emacs" + diff --git a/.config/nvim/after/plugin/quickscope.lua b/.config/nvim/after/plugin/quickscope.lua new file mode 100644 index 0000000..9fa10fe --- /dev/null +++ b/.config/nvim/after/plugin/quickscope.lua @@ -0,0 +1,7 @@ +-- Quickscope +vim.g.qs_highlight_on_keys = { 'f', 'F', 't', 'T' } +vim.g.qs_max_chars=150 +vim.cmd [[ +highlight QuickScopePrimary guifg='#00C7DF' gui=underline ctermfg=155 cterm=underline +highlight QuickScopeSecondary guifg='#afff5f' gui=underline ctermfg=81 cterm=underline +]] diff --git a/.config/nvim/after/plugin/rainbow.lua b/.config/nvim/after/plugin/rainbow.lua new file mode 100644 index 0000000..e0951b8 --- /dev/null +++ b/.config/nvim/after/plugin/rainbow.lua @@ -0,0 +1,23 @@ +-- Rainbow +-- This module contains a number of default definitions +local rainbow_delimiters = require 'rainbow-delimiters' + +vim.g.rainbow_delimiters = { + strategy = { + [''] = rainbow_delimiters.strategy['global'], + vim = rainbow_delimiters.strategy['local'], + }, + query = { + [''] = 'rainbow-delimiters', + lua = 'rainbow-blocks', + }, + highlight = { + 'RainbowDelimiterOrange', + 'RainbowDelimiterRed', + 'RainbowDelimiterYellow', + 'RainbowDelimiterBlue', + 'RainbowDelimiterGreen', + 'RainbowDelimiterViolet', + 'RainbowDelimiterCyan', + }, +} diff --git a/.config/nvim/after/plugin/signify.lua b/.config/nvim/after/plugin/signify.lua new file mode 100644 index 0000000..a0a0a1d --- /dev/null +++ b/.config/nvim/after/plugin/signify.lua @@ -0,0 +1 @@ +vim.g.signify_priority = 9 diff --git a/.config/nvim/after/plugin/startify.lua b/.config/nvim/after/plugin/startify.lua new file mode 100644 index 0000000..a5d3efc --- /dev/null +++ b/.config/nvim/after/plugin/startify.lua @@ -0,0 +1,29 @@ +-- Startify +vim.cmd [[ +let g:startify_custom_header = startify#pad([ +\ '==========================', +\ '====== ================', +\ '======= =================', +\ '======= =================', +\ '======= ==== ==== ===', +\ '======= === == = ==', +\ '======= === = == ==', +\ '== === === = == =====', +\ '== === === = == = ==', +\ '=== ===== ==== ===', +\ '==========================', +\ ]) +let g:startify_lists = [ + \ { 'type': 'sessions', 'header': startify#pad(['Sessions']) }, + \ { 'type': 'files', 'header': startify#pad(['Recent']) }, + \ { 'type': 'bookmarks', 'header': startify#pad(['Bookmarks']) }, + \ { 'type': 'commands', 'header': startify#pad(['Commands']) }, + \ ] +]] +vim.g.startify_bookmarks = { + { env = '~/.config/env' }, + { v = '~/.config/nvim/init.vim' }, + { zc = '~/.config/zsh/.zshrc' }, + { za = '~/.config/zsh/alias.zsh' }, + { gj = '~/dev/go/gojosh' }, +} diff --git a/.config/nvim/after/plugin/treesitter.lua b/.config/nvim/after/plugin/treesitter.lua new file mode 100644 index 0000000..62b960b --- /dev/null +++ b/.config/nvim/after/plugin/treesitter.lua @@ -0,0 +1,34 @@ +require'nvim-treesitter.configs'.setup { + -- A list of parser names, or "all" (the five listed parsers should always be installed) + ensure_installed = { "c", "cpp", "lua", "vim", "vimdoc", "query", "go" }, + + -- 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, + + highlight = { + 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 + -- Or use a function for more flexibility, e.g. to disable slow treesitter highlight for large files + disable = function(lang, 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/after/plugin/whichkey.lua b/.config/nvim/after/plugin/whichkey.lua new file mode 100644 index 0000000..71274e1 --- /dev/null +++ b/.config/nvim/after/plugin/whichkey.lua @@ -0,0 +1,56 @@ + +local ts = require('telescope.builtin') +local wk = require('which-key') +wk.register({ + b = { ':Buffers', 'buffers', noremap = true, silent = true }, + c = { name = '+nerd-commenter' }, + d = { ':bd', 'close buffer', noremap = true, silent = false }, + e = { ':Telescope find_files', 'find files', noremap = true, silent = true }, + G = { ':FloatermNew lazygit', 'lazygit', noremap = true, silent = true }, + h = { ':Startify', 'startify', noremap = true, silent = true }, + k = { ':w:bp:bd #', 'write and close buffer', noremap = true, silent = false }, + p = { ':CocList -A --normal yank', 'CoC paste', noremap = true, silent = true }, + u = { ':UndotreeShow', 'undotree', noremap = true, silent = true }, + v = { ':FloatermNew vifm', 'vifm', noremap = true, silent = true }, + w = { ':w', 'write buffer', noremap = true, silent = false }, + x = { ':w:bp:bd #', 'write and close buffer', noremap = true, silent = false }, + q = { name = '+coc-fix-current' }, + r = { name = '+coc-rename' }, + f = { + name = 'telescope', + -- f = { ':Telescope find_files', 'find files', noremap = true, silent = true }, + f = { ts.find_files, 'find files', noremap = true, silent = true }, + g = { ts.git_files, 'git files', noremap = true, silent = true }, + s = { function() + ts.grep_string({ search = vim.fn.input("Grep > ") }) + end, 'grep string', noremap = true, silent = true }, + }, + g = { + name = 'grep', + a = { ':Ag', 'the_silver_searcher', noremap = true, silent = true }, + g = { ':Grep', 'grep', noremap = true, silent = true }, + r = { ':Rg', 'ripgrep', noremap = true, silent = true }, + }, + v = { + name = 'nvim', + v = { vim.cmd.Ex, 'explorer', noremap = true, silent = true }, + u = { ':PlugUpgrade:PlugUpdate', 'upgrade', noremap = true, silent = true }, + }, +}, { prefix = '', }) +wk.setup({ + plugins = { + presets = { + operators = false, + motions = false, + text_objects = false, + window = false, + nav = false, + z = false, + g = false + }, + }, + triggers = { "" }, + triggers_nowait = { "d" }, +}) + +vim.keymap.set('n', '', ts.git_files) diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index b4eefd1..7746dbb 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -20,15 +20,15 @@ require('settings') require('bindings') require('sidebars') require('langs') -require('plugs-config/asyncomplete') -require('plugs-config/floaterm') -require('plugs-config/lualine') -require('plugs-config/nerd-commenter') -require('plugs-config/org') -require('plugs-config/quickscope') -require('plugs-config/rainbow') -require('plugs-config/signify') -require('plugs-config/startify') -require('plugs-config/treesitter') -require('plugs-config/whichkey') +-- require('plugs-config/asyncomplete') +-- require('plugs-config/floaterm') +-- require('plugs-config/lualine') +-- require('plugs-config/nerd-commenter') +-- require('plugs-config/org') +-- require('plugs-config/quickscope') +-- require('plugs-config/rainbow') +-- require('plugs-config/signify') +-- require('plugs-config/startify') +-- require('plugs-config/treesitter') +-- require('plugs-config/whichkey') vim.cmd('source ' .. confdir .. '/nvim/plug-config/vim-lsp.vim') diff --git a/.config/nvim/lua/plugs-config/asyncomplete.lua b/.config/nvim/lua/plugs-config/asyncomplete.lua deleted file mode 100644 index da28c37..0000000 --- a/.config/nvim/lua/plugs-config/asyncomplete.lua +++ /dev/null @@ -1,13 +0,0 @@ -vim.cmd [[ -autocmd User asyncomplete_setup call asyncomplete#register_source( - \ asyncomplete#sources#clang#get_source_options({ - \ 'config': { - \ 'clang_path': '/usr/bin/cc', - \ 'clang_args': { - \ 'default': ['-I/usr/include'], - \ 'c': ['-std=c89', '-I/usr/include'], - \ 'cpp': ['-std=c++98', '-I/usr/include'] - \ } - \ } - \ })) -]] diff --git a/.config/nvim/lua/plugs-config/floaterm.lua b/.config/nvim/lua/plugs-config/floaterm.lua deleted file mode 100644 index 7f80d65..0000000 --- a/.config/nvim/lua/plugs-config/floaterm.lua +++ /dev/null @@ -1,9 +0,0 @@ -vim.g.floaterm_autoinsert = 1 -vim.g.floaterm_width = 0.6 -vim.g.floaterm_height = 0.45 -vim.g.floaterm_wintitle = 0 -vim.g.floaterm_autoclose = 1 -vim.g.floaterm_position = 'bottom' -vim.g.floaterm_gitcommit = 'split' -vim.g.floaterm_wintype = 'floating' -vim.g.floaterm_rootmarkers = { '.project', '.git', '.hg', '.svn', '.root', '.gitignore', '.fslckout', '.fossil-settings' } diff --git a/.config/nvim/lua/plugs-config/lualine.lua b/.config/nvim/lua/plugs-config/lualine.lua deleted file mode 100644 index f3d2fe7..0000000 --- a/.config/nvim/lua/plugs-config/lualine.lua +++ /dev/null @@ -1,349 +0,0 @@ --- Eviline config for lualine --- Author: shadmansaleh --- Credit: glepnir -local lualine = require('lualine') - --- Color table for highlights --- stylua: ignore -local colors = { - bg = '#202328', - fg = '#bbc2cf', - yellow = '#ECBE7B', - cyan = '#008080', - darkblue = '#081633', - green = '#98be65', - orange = '#FF8800', - violet = '#a9a1e1', - magenta = '#c678dd', - blue = '#51afef', - red = '#ec5f67', -} - -local conditions = { - buffer_not_empty = function() - return vim.fn.empty(vim.fn.expand('%:t')) ~= 1 - end, - hide_in_width = function() - return vim.fn.winwidth(0) > 80 - end, - check_git_workspace = function() - local filepath = vim.fn.expand('%:p:h') - local gitdir = vim.fn.finddir('.git', filepath .. ';') - return gitdir and #gitdir > 0 and #gitdir < #filepath - end, -} - --- Config -local config = { - options = { - -- Disable sections and component separators - component_separators = '', - section_separators = '', - theme = { - -- We are going to use lualine_c an lualine_x as left and - -- right section. Both are highlighted by c theme . So we - -- are just setting default looks o statusline - normal = { c = { fg = colors.fg, bg = colors.bg } }, - inactive = { c = { fg = colors.fg, bg = colors.bg } }, - }, - }, - sections = { - -- these are to remove the defaults - lualine_a = {}, - lualine_b = {}, - lualine_y = {}, - lualine_z = {}, - -- These will be filled later - lualine_c = {}, - lualine_x = {}, - }, - inactive_sections = { - -- these are to remove the defaults - lualine_a = {}, - lualine_b = {}, - lualine_y = {}, - lualine_z = {}, - lualine_c = {}, - lualine_x = {}, - }, -} - --- Inserts a component in lualine_c at left section -local function ins_left(component) - table.insert(config.sections.lualine_c, component) -end - --- Inserts a component in lualine_x at right section -local function ins_right(component) - table.insert(config.sections.lualine_x, component) -end - -ins_left { - function() - return '▊' - end, - -- color = { fg = colors.green }, -- Sets highlighting of component - color = function() - -- auto change color according to neovims mode - local mode_color = { - n = colors.green, - i = colors.blue, - v = colors.magenta, - [''] = colors.magenta, - V = colors.magenta, - c = colors.yellow, - no = colors.red, - s = colors.orange, - S = colors.orange, - [''] = colors.orange, - ic = colors.yellow, - R = colors.red, - Rv = colors.violet, - cv = colors.red, - ce = colors.red, - r = colors.cyan, - rm = colors.cyan, - ['r?'] = colors.cyan, - ['!'] = colors.red, - t = colors.red, - } - return { fg = mode_color[vim.fn.mode()] } - end, - padding = { left = 0, right = 1 }, -- We don't need space before this -} - -ins_left { - -- mode component - function() - return '' - end, - color = function() - -- auto change color according to neovims mode - local mode_color = { - n = colors.green, - i = colors.blue, - v = colors.magenta, - [''] = colors.magenta, - V = colors.magenta, - c = colors.yellow, - no = colors.red, - s = colors.orange, - S = colors.orange, - [''] = colors.orange, - ic = colors.yellow, - R = colors.red, - Rv = colors.violet, - cv = colors.red, - ce = colors.red, - r = colors.cyan, - rm = colors.cyan, - ['r?'] = colors.cyan, - ['!'] = colors.red, - t = colors.red, - } - return { fg = mode_color[vim.fn.mode()] } - end, - padding = { right = 1 }, -} - --- ins_left { --- 'filename', --- cond = conditions.buffer_not_empty, --- color = { fg = colors.magenta, gui = 'bold' }, --- } - -ins_left { - 'buffers', - show_filename_only = false, - hide_filename_extension = false, - show_modified_status = true, - icons_enabled = true, - symbols = { - modified = ' ●', -- Text to show when the buffer is modified - alternate_file = '', -- Text to show to identify the alternate file - directory = '', -- Text to show when the buffer is a directory - }, - buffers_color = { - -- Same values as the general color option can be used here. - active = function() - -- auto change color according to neovims mode - local mode_color = { - n = colors.green, - i = colors.blue, - v = colors.magenta, - [''] = colors.magenta, - V = colors.magenta, - c = colors.yellow, - no = colors.red, - s = colors.orange, - S = colors.orange, - [''] = colors.orange, - ic = colors.yellow, - R = colors.red, - Rv = colors.violet, - cv = colors.red, - ce = colors.red, - r = colors.cyan, - rm = colors.cyan, - ['r?'] = colors.cyan, - ['!'] = colors.red, - t = colors.red, - } - return { fg = mode_color[vim.fn.mode()], gui = 'bold' } - end, - }, -} - -ins_left { - 'diagnostics', - sources = { 'nvim_diagnostic' }, - symbols = { error = ' ', warn = ' ', info = ' ' }, - diagnostics_color = { - color_error = { fg = colors.red }, - color_warn = { fg = colors.yellow }, - color_info = { fg = colors.cyan }, - }, -} - --- Insert mid section. You can make any number of sections in neovim :) --- for lualine it's any number greater then 2 --- ins_left { --- function() --- return '%=' --- end, --- } - -ins_right { - 'filetype', - icons_enabled = true, -- I think icons are cool but Eviline doesn't have them. sigh - color = { fg = colors.blue }, -} - -ins_right { - -- Lsp server name . - function() - local msg = 'no lsp' - local buf_ft = vim.api.nvim_buf_get_option(0, 'filetype') - local clients = vim.lsp.get_active_clients() - if next(clients) == nil then - -- icon = '' - return - end - for _, client in ipairs(clients) do - local filetypes = client.config.filetypes - if filetypes and vim.fn.index(filetypes, buf_ft) ~= -1 then - return client.name - end - end - return msg - end, - icon = ' ', - color = { fg = colors.cyan }, -} - -ins_right { - 'branch', - icon = '', - color = { fg = colors.violet, gui = 'bold' }, -} - -ins_right { - -- filesize component - 'filesize', - cond = conditions.buffer_not_empty, -} - -ins_right { - 'diff', - -- Is it me or the symbol for modified us really weird - symbols = { added = ' ', modified = '󰝤 ', removed = ' ' }, - diff_color = { - added = { fg = colors.green }, - modified = { fg = colors.orange }, - removed = { fg = colors.red }, - }, - cond = conditions.hide_in_width, -} - -ins_right { 'location' } - -ins_right { - function() - return '▊' - end, - -- color = { fg = colors.green }, - color = function() - -- auto change color according to neovims mode - local mode_color = { - n = colors.green, - i = colors.blue, - v = colors.magenta, - [''] = colors.magenta, - V = colors.magenta, - c = colors.yellow, - no = colors.red, - s = colors.orange, - S = colors.orange, - [''] = colors.orange, - ic = colors.yellow, - R = colors.red, - Rv = colors.violet, - cv = colors.red, - ce = colors.red, - r = colors.cyan, - rm = colors.cyan, - ['r?'] = colors.cyan, - ['!'] = colors.red, - t = colors.red, - } - return { fg = mode_color[vim.fn.mode()] } - end, - padding = { left = 1 }, -} - --- Now don't forget to initialize lualine -lualine.setup(config) - - - - --- require('lualine').setup { --- options = { --- icons_enabled = true, --- theme = 'gruvbox', --- section_separators = { left = '', right = '' }, --- component_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 = { 'buffers' }, --- lualine_y = { 'filetype' }, --- lualine_z = { 'location' } --- }, --- inactive_sections = { --- lualine_a = {}, --- lualine_b = {}, --- lualine_c = { 'filename' }, --- lualine_x = {}, --- lualine_y = {}, --- lualine_z = {} --- }, --- tabline = {}, --- winbar = {}, --- inactive_winbar = {}, --- extensions = {}, --- } diff --git a/.config/nvim/lua/plugs-config/nerd-commenter.lua b/.config/nvim/lua/plugs-config/nerd-commenter.lua deleted file mode 100644 index ddfadf2..0000000 --- a/.config/nvim/lua/plugs-config/nerd-commenter.lua +++ /dev/null @@ -1,14 +0,0 @@ --- NERD Commenter -vim.g.NERDSpaceDelims = 1 -vim.g.NERDCompactSexyComs = 1 -vim.g.NERDDefaultAlign = 'left' -vim.g.NERDAltDelims_java = 1 -vim.g.NERDCustomDelimiters = { - c = { - left = '/*', - right = '*/', - } -} -vim.g.NERDCommentEmptyLines = 1 -vim.g.NERDTrimTrailingWhitespace = 1 -vim.g.NERDToggleCheckAllLines = 1 diff --git a/.config/nvim/lua/plugs-config/org.lua b/.config/nvim/lua/plugs-config/org.lua deleted file mode 100644 index 662ad08..0000000 --- a/.config/nvim/lua/plugs-config/org.lua +++ /dev/null @@ -1,4 +0,0 @@ --- Org-mode -vim.g.org_todo_keywords = { 'TODO', '|', 'DONE', 'CANCELED' } -vim.g.org_export_emacs = "/usr/bin/emacs" - diff --git a/.config/nvim/lua/plugs-config/quickscope.lua b/.config/nvim/lua/plugs-config/quickscope.lua deleted file mode 100644 index 9fa10fe..0000000 --- a/.config/nvim/lua/plugs-config/quickscope.lua +++ /dev/null @@ -1,7 +0,0 @@ --- Quickscope -vim.g.qs_highlight_on_keys = { 'f', 'F', 't', 'T' } -vim.g.qs_max_chars=150 -vim.cmd [[ -highlight QuickScopePrimary guifg='#00C7DF' gui=underline ctermfg=155 cterm=underline -highlight QuickScopeSecondary guifg='#afff5f' gui=underline ctermfg=81 cterm=underline -]] diff --git a/.config/nvim/lua/plugs-config/rainbow.lua b/.config/nvim/lua/plugs-config/rainbow.lua deleted file mode 100644 index e0951b8..0000000 --- a/.config/nvim/lua/plugs-config/rainbow.lua +++ /dev/null @@ -1,23 +0,0 @@ --- Rainbow --- This module contains a number of default definitions -local rainbow_delimiters = require 'rainbow-delimiters' - -vim.g.rainbow_delimiters = { - strategy = { - [''] = rainbow_delimiters.strategy['global'], - vim = rainbow_delimiters.strategy['local'], - }, - query = { - [''] = 'rainbow-delimiters', - lua = 'rainbow-blocks', - }, - highlight = { - 'RainbowDelimiterOrange', - 'RainbowDelimiterRed', - 'RainbowDelimiterYellow', - 'RainbowDelimiterBlue', - 'RainbowDelimiterGreen', - 'RainbowDelimiterViolet', - 'RainbowDelimiterCyan', - }, -} diff --git a/.config/nvim/lua/plugs-config/signify.lua b/.config/nvim/lua/plugs-config/signify.lua deleted file mode 100644 index a0a0a1d..0000000 --- a/.config/nvim/lua/plugs-config/signify.lua +++ /dev/null @@ -1 +0,0 @@ -vim.g.signify_priority = 9 diff --git a/.config/nvim/lua/plugs-config/startify.lua b/.config/nvim/lua/plugs-config/startify.lua deleted file mode 100644 index a5d3efc..0000000 --- a/.config/nvim/lua/plugs-config/startify.lua +++ /dev/null @@ -1,29 +0,0 @@ --- Startify -vim.cmd [[ -let g:startify_custom_header = startify#pad([ -\ '==========================', -\ '====== ================', -\ '======= =================', -\ '======= =================', -\ '======= ==== ==== ===', -\ '======= === == = ==', -\ '======= === = == ==', -\ '== === === = == =====', -\ '== === === = == = ==', -\ '=== ===== ==== ===', -\ '==========================', -\ ]) -let g:startify_lists = [ - \ { 'type': 'sessions', 'header': startify#pad(['Sessions']) }, - \ { 'type': 'files', 'header': startify#pad(['Recent']) }, - \ { 'type': 'bookmarks', 'header': startify#pad(['Bookmarks']) }, - \ { 'type': 'commands', 'header': startify#pad(['Commands']) }, - \ ] -]] -vim.g.startify_bookmarks = { - { env = '~/.config/env' }, - { v = '~/.config/nvim/init.vim' }, - { zc = '~/.config/zsh/.zshrc' }, - { za = '~/.config/zsh/alias.zsh' }, - { gj = '~/dev/go/gojosh' }, -} diff --git a/.config/nvim/lua/plugs-config/treesitter.lua b/.config/nvim/lua/plugs-config/treesitter.lua deleted file mode 100644 index 62b960b..0000000 --- a/.config/nvim/lua/plugs-config/treesitter.lua +++ /dev/null @@ -1,34 +0,0 @@ -require'nvim-treesitter.configs'.setup { - -- A list of parser names, or "all" (the five listed parsers should always be installed) - ensure_installed = { "c", "cpp", "lua", "vim", "vimdoc", "query", "go" }, - - -- 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, - - highlight = { - 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 - -- Or use a function for more flexibility, e.g. to disable slow treesitter highlight for large files - disable = function(lang, 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/lua/plugs-config/whichkey.lua b/.config/nvim/lua/plugs-config/whichkey.lua deleted file mode 100644 index 9529229..0000000 --- a/.config/nvim/lua/plugs-config/whichkey.lua +++ /dev/null @@ -1,43 +0,0 @@ - -local wk = require("which-key") -wk.register({ - b = { ':Buffers', 'buffers', noremap = true, silent = true }, - c = { name = '+nerd-commenter' }, - d = { ':bd', 'close buffer', noremap = true, silent = false }, - e = { ':Files', 'files', noremap = true, silent = true }, - G = { ':FloatermNew lazygit', 'lazygit', noremap = true, silent = true }, - h = { ':Startify', 'startify', noremap = true, silent = true }, - k = { ':w:bp:bd #', 'write and close buffer', noremap = true, silent = false }, - p = { ':CocList -A --normal yank', 'CoC paste', noremap = true, silent = true }, - u = { ':UndotreeShow', 'undotree', noremap = true, silent = true }, - v = { ':FloatermNew vifm', 'vifm', noremap = true, silent = true }, - w = { ':w', 'write buffer', noremap = true, silent = false }, - x = { ':w:bp:bd #', 'write and close buffer', noremap = true, silent = false }, - q = { name = '+coc-fix-current' }, - r = { name = '+coc-rename' }, - f = { - name = 'telescope', - f = { ':Telescope find_files', 'find files', noremap = true, silent = true }, - }, - g = { - name = 'grep', - a = { ':Ag', 'the_silver_searcher', noremap = true, silent = true }, - g = { ':Grep', 'grep', noremap = true, silent = true }, - r = { ':Rg', 'ripgrep', noremap = true, silent = true }, - }, -}, { prefix = '', }) -wk.setup({ - plugins = { - presets = { - operators = false, - motions = false, - text_objects = false, - window = false, - nav = false, - z = false, - g = false - }, - }, - triggers = { "" }, - triggers_nowait = { "d" }, -}) diff --git a/.config/nvim/plug-config/vim-lsp.vim b/.config/nvim/plug-config/vim-lsp.vim index fb0d055..5e5ca16 100644 --- a/.config/nvim/plug-config/vim-lsp.vim +++ b/.config/nvim/plug-config/vim-lsp.vim @@ -1,39 +1,39 @@ -if executable('ccls') - autocmd User lsp_setup call lsp#register_server({ - \ 'name': 'ccls', - \ 'cmd': {server_info->['ccls']}, - \ 'root_uri': {server_info->lsp#utils#path_to_uri(lsp#utils#find_nearest_parent_file_directory(lsp#utils#get_buffer_path(), 'compile_commands.json'))}, - \ 'initialization_options': { - \ 'highlight': { 'lsRanges' : v:true }, - \ }, - \ 'whitelist': ['c', 'cpp', 'objc', 'objcpp', 'cc'], - \ }) - autocmd FileType c,cpp,objc,objcpp,cc setlocal omnifunc=lsp#complete -endif - -highlight LspCxxHlSymStruct ctermfg=Yellow guifg=Yellow -highlight LspCxxHlSymClass ctermfg=Yellow guifg=Yellow -highlight LspCxxHlSymField ctermfg=Blue guifg=Blue -highlight LspCxxHlSymParameter ctermfg=LightYellow guifg=LightYellow -highlight LspCxxHlSymVariableStatic ctermfg=LightRed guifg=LightRed -highlight LspErrorHighlight cterm=undercurl gui=undercurl ctermfg=DarkRed guifg=DarkRed -highlight LspWarningHighlight cterm=underline gui=underline ctermfg=DarkRed guifg=DarkRed -highlight LspInformationHighlight cterm=underline gui=underline ctermfg=Green guifg=Green -highlight LspHintHighlight term=italic cterm=italic gui=italic ctermfg=Green guifg=Green - -augroup LspGo - au! - autocmd User lsp_setup call lsp#register_server({ - \ 'name': 'go-lang', - \ 'cmd': {server_info->['gopls']}, - \ 'whitelist': ['go'], - \ }) - autocmd FileType go setlocal omnifunc=lsp#complete - "autocmd FileType go nmap gd (lsp-definition) - "autocmd FileType go nmap ,n (lsp-next-error) - "autocmd FileType go nmap ,p (lsp-previous-error) -augroup END - -let g:lsp_signs_priority = 10 -let g:lsp_textprop_enabled = 1 -let g:lsp_cxx_hl_use_text_props = 1 +" if executable('ccls') +" autocmd User lsp_setup call lsp#register_server({ +" \ 'name': 'ccls', +" \ 'cmd': {server_info->['ccls']}, +" \ 'root_uri': {server_info->lsp#utils#path_to_uri(lsp#utils#find_nearest_parent_file_directory(lsp#utils#get_buffer_path(), 'compile_commands.json'))}, +" \ 'initialization_options': { +" \ 'highlight': { 'lsRanges' : v:true }, +" \ }, +" \ 'whitelist': ['c', 'cpp', 'objc', 'objcpp', 'cc'], +" \ }) +" autocmd FileType c,cpp,objc,objcpp,cc setlocal omnifunc=lsp#complete +" endif +" +" highlight LspCxxHlSymStruct ctermfg=Yellow guifg=Yellow +" highlight LspCxxHlSymClass ctermfg=Yellow guifg=Yellow +" highlight LspCxxHlSymField ctermfg=Blue guifg=Blue +" highlight LspCxxHlSymParameter ctermfg=LightYellow guifg=LightYellow +" highlight LspCxxHlSymVariableStatic ctermfg=LightRed guifg=LightRed +" highlight LspErrorHighlight cterm=undercurl gui=undercurl ctermfg=DarkRed guifg=DarkRed +" highlight LspWarningHighlight cterm=underline gui=underline ctermfg=DarkRed guifg=DarkRed +" highlight LspInformationHighlight cterm=underline gui=underline ctermfg=Green guifg=Green +" highlight LspHintHighlight term=italic cterm=italic gui=italic ctermfg=Green guifg=Green +" +" augroup LspGo +" au! +" autocmd User lsp_setup call lsp#register_server({ +" \ 'name': 'go-lang', +" \ 'cmd': {server_info->['gopls']}, +" \ 'whitelist': ['go'], +" \ }) +" autocmd FileType go setlocal omnifunc=lsp#complete +" "autocmd FileType go nmap gd (lsp-definition) +" "autocmd FileType go nmap ,n (lsp-next-error) +" "autocmd FileType go nmap ,p (lsp-previous-error) +" augroup END +" +" let g:lsp_signs_priority = 10 +" let g:lsp_textprop_enabled = 1 +" let g:lsp_cxx_hl_use_text_props = 1 -- cgit v1.2.3