aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.config/nvim/autoload/utils.vim26
-rw-r--r--.config/nvim/init.lua65
-rw-r--r--.config/nvim/lua/plugins/cmp-gh-source.lua74
-rw-r--r--.config/nvim/lua/plugins/dashboard.lua50
-rw-r--r--.config/nvim/lua/plugins/fzf.lua (renamed from .config/nvim/lua/user/func.lua)78
-rw-r--r--.config/nvim/lua/plugins/git.lua11
-rw-r--r--.config/nvim/lua/plugins/heirline.lua1
-rw-r--r--.config/nvim/lua/plugins/leetcode.lua68
-rw-r--r--.config/nvim/lua/plugins/lsp.lua16
-rw-r--r--.config/nvim/lua/plugins/lspsaga.lua46
-rw-r--r--.config/nvim/lua/plugins/notify.lua18
-rw-r--r--.config/nvim/lua/plugins/null-ls.lua173
-rw-r--r--.config/nvim/lua/plugins/nvim-tree.lua1
-rw-r--r--.config/nvim/lua/plugins/prettier.lua19
-rw-r--r--.config/nvim/lua/plugins/scripts/lsp-ext.lua48
-rw-r--r--.config/nvim/lua/plugins/scripts/setcolors.lua121
-rw-r--r--.config/nvim/lua/plugins/scripts/toggleLsp.lua40
-rw-r--r--.config/nvim/lua/plugins/telescope.lua64
-rw-r--r--.config/nvim/lua/user/keys.lua6
-rw-r--r--.config/nvim/lua/user/mods.lua2
-rw-r--r--.config/nvim/lua/user/opts.lua98
-rw-r--r--.config/nvim/lua/user/pack.lua16
-rw-r--r--.config/nvim/lua/user/view.lua68
23 files changed, 398 insertions, 711 deletions
diff --git a/.config/nvim/autoload/utils.vim b/.config/nvim/autoload/utils.vim
index f11a769..23a9178 100644
--- a/.config/nvim/autoload/utils.vim
+++ b/.config/nvim/autoload/utils.vim
@@ -208,4 +208,30 @@ function! utils#BeforeWrite()
endif
endfunction
+
+"-------------------------------------------------
+
+" On The Fly Table mode
+function! s:isAtStartOfLine(mapping)
+ let text_before_cursor = getline('.')[0 : col('.')-1]
+ let mapping_pattern = '\V' . escape(a:mapping, '\')
+ let comment_pattern = '\V' . escape(substitute(&l:commentstring, '%s.*$', '', ''), '\')
+ return (text_before_cursor =~? '^' . ('\v(' . comment_pattern . '\v)?') . '\s*\v' . mapping_pattern . '\v$')
+endfunction
+
+
+"-------------------------------------------------
+
+" :Rename {newname}
+function! utils#RenameFile()
+ let old_name = expand('%')
+ let new_name = input('New file name: ', expand('%'), 'file')
+ if new_name != '' && new_name != old_name
+ exec ':saveas ' . new_name
+ exec ':silent !rm ' . old_name
+ redraw!
+ endif
+endfunction
+
+
"-------------------------------------------------
diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua
index d1f9911..0ab542c 100644
--- a/.config/nvim/init.lua
+++ b/.config/nvim/init.lua
@@ -62,10 +62,9 @@ local modules = {
'user.opts', -- Options
'user.keys', -- Keymaps
'user.mods', -- Modules/functions
- --"user.scripts",
+ 'user.view', -- Colorscheme/UI
'plugins.treesitter',
'plugins.neodev',
- --'plugins.colorscheme',
'plugins.telescope',
'plugins.nvim-tree',
'plugins.web-devicons',
@@ -95,6 +94,8 @@ local modules = {
'plugins.dashboard',
'plugins.which-key',
'plugins.harpoon',
+ 'plugins.leetcode',
+ --'plugins.notify',
--"plugins.modify-blend",
}
@@ -141,63 +142,3 @@ vim.g.did_load_filetypes = 0
-- Notifications
vim.notify = require('notify') -- Requires plugin "rcarriga/nvim-notify"
-
--- Colorscheme
-
--- Colors
-vim.opt.termguicolors = true
-
--- Available colorschemes:
--- [[ nightfly ayu onedark doom-one nvimgelion github_dark tokyonight ]]
-
-require('tokyonight').setup({
- style = 'night',
- transparent = true,
- transparent_sidebar = true,
- styles = {
- sidebars = 'transparent',
- floats = 'transparent',
- },
-})
-
--- Define default color scheme
-local default_colorscheme = 'tokyonight'
-local fallback_colorscheme = 'desert'
-
--- Attempt to set the default color scheme
-local status_ok, _ = pcall(vim.cmd, 'colorscheme ' .. default_colorscheme)
-
--- If the default color scheme is not found, use the fallback color scheme
-if not status_ok then
- vim.cmd('colorscheme ' .. fallback_colorscheme)
-end
-
-vim.api.nvim_command('syntax on')
-vim.api.nvim_command('highlight Normal guibg=NONE ctermbg=NONE')
-vim.api.nvim_command('highlight NonText guibg=NONE ctermbg=NONE')
-vim.api.nvim_command('highlight NormalNC guibg=NONE')
-vim.api.nvim_command('highlight SignColumn guibg=NONE')
-vim.api.nvim_command('highlight FoldColumn guibg=NONE')
-vim.api.nvim_command('highlight CursorLineSign guibg=NONE ctermbg=NONE')
-vim.api.nvim_command('highlight TabLine guibg=#333842 gui=bold')
-vim.api.nvim_command('highlight Title guibg=NONE gui=bold')
-vim.api.nvim_command('highlight TabLineSel guibg=#333842 gui=bold')
-vim.api.nvim_command('highlight TabLineFill guibg=NONE gui=bold')
-vim.api.nvim_command('highlight WinBar guibg=NONE gui=bold')
-vim.api.nvim_command('highlight NormalFloat guibg=NONE')
-vim.api.nvim_command('highlight LineNr guibg=NONE')
-vim.api.nvim_command('highlight WinSeparator guibg=NONE gui=bold')
-vim.api.nvim_command('highlight MsgSeparator guibg=NONE')
-vim.api.nvim_command('highlight PmenuSel guibg=NONE')
-vim.api.nvim_command('highlight winblend guibg=NONE')
-vim.api.nvim_command('highlight EndOfBuffer guibg=NONE guifg=Normal')
-
--- Set different window separator colorscheme
-vim.cmd([[
-au WinEnter * setl winhl=WinSeparator:WinSeparatorA
-au WinLeave * setl winhl=WinSeparator:WinSeparator
-]])
-
-require('notify').setup({
- background_colour = '#000000',
-})
diff --git a/.config/nvim/lua/plugins/cmp-gh-source.lua b/.config/nvim/lua/plugins/cmp-gh-source.lua
index 05bba55..4990c35 100644
--- a/.config/nvim/lua/plugins/cmp-gh-source.lua
+++ b/.config/nvim/lua/plugins/cmp-gh-source.lua
@@ -1,4 +1,4 @@
-local ok, Job = pcall(require, "plenary.job")
+local ok, Job = pcall(require, 'plenary.job')
if not ok then
return
end
@@ -19,54 +19,52 @@ source.complete = function(self, _, callback)
-- You could remove this if you wanted, but this just makes it so we're
-- good programming citizens.
if not self.cache[bufnr] then
- Job
- :new({
- -- Uses `gh` executable to request the issues from the remote repository.
- "gh",
- "issue",
- "list",
- "--limit",
- "1000",
- "--json",
- "title,number,body",
+ Job:new({
+ -- Uses `gh` executable to request the issues from the remote repository.
+ 'gh',
+ 'issue',
+ 'list',
+ '--limit',
+ '1000',
+ '--json',
+ 'title,number,body',
- on_exit = function(job)
- local result = job:result()
- local ok, parsed = pcall(vim.json.decode, table.concat(result, ""))
- if not ok then
- vim.notify "Failed to parse gh result"
- return
- end
+ on_exit = function(job)
+ local result = job:result()
+ local ok, parsed = pcall(vim.json.decode, table.concat(result, ''))
+ if not ok then
+ vim.notify('Failed to parse gh result')
+ return
+ end
- local items = {}
- for _, gh_item in ipairs(parsed) do
- gh_item.body = string.gsub(gh_item.body or "", "\r", "")
+ local items = {}
+ for _, gh_item in ipairs(parsed) do
+ gh_item.body = string.gsub(gh_item.body or '', '\r', '')
- table.insert(items, {
- label = string.format("#%s", gh_item.number),
- documentation = {
- kind = "markdown",
- value = string.format("# %s\n\n%s", gh_item.title, gh_item.body),
- },
- })
- end
+ table.insert(items, {
+ label = string.format('#%s', gh_item.number),
+ documentation = {
+ kind = 'markdown',
+ value = string.format('# %s\n\n%s', gh_item.title, gh_item.body),
+ },
+ })
+ end
- callback { items = items, isIncomplete = false }
- self.cache[bufnr] = items
- end,
- })
- :start()
+ callback({ items = items, isIncomplete = false })
+ self.cache[bufnr] = items
+ end,
+ }):start()
else
- callback { items = self.cache[bufnr], isIncomplete = false }
+ callback({ items = self.cache[bufnr], isIncomplete = false })
end
end
source.get_trigger_characters = function()
- return { "#" }
+ return { '#' }
end
source.is_available = function()
- return vim.bo.filetype == "gitcommit"
+ return vim.bo.filetype == 'gitcommit'
end
-require("cmp").register_source("gh_issues", source.new())
+require('cmp').register_source('gh_issues', source.new())
diff --git a/.config/nvim/lua/plugins/dashboard.lua b/.config/nvim/lua/plugins/dashboard.lua
index a78332b..e25d536 100644
--- a/.config/nvim/lua/plugins/dashboard.lua
+++ b/.config/nvim/lua/plugins/dashboard.lua
@@ -1,4 +1,4 @@
-local db = require('dashboard')
+local db = require("dashboard")
--vim.api.nvim_create_autocmd("VimEnter", {
-- callback = function()
@@ -10,9 +10,9 @@ local db = require('dashboard')
--})
db.setup({
- theme = 'hyper',
+ theme = "hyper",
config = {
- mru = { limit = 10, label = '' },
+ mru = { limit = 10, label = "" },
project = { limit = 10 },
header = {
[[ ███╗ ██╗ ███████╗ ██████╗ ██╗ ██╗ ██╗ ███╗ ███╗]],
@@ -24,45 +24,45 @@ db.setup({
},
disable_move = false,
shortcut = {
- { desc = ' Plugins', group = 'Number', action = 'PackerStatus', key = 'p' },
+ { desc = " Plugins", group = "Number", action = "PackerStatus", key = "p" },
--{ desc = " Plugins", group = "@property", action = "PackerStatus", key = "p" },
{
- desc = ' Files',
- group = 'Number',
+ desc = " Files",
+ group = "Number",
--group = "Label",
- action = 'Telescope find_files',
- key = 'f',
+ action = "Telescope find_files",
+ key = "f",
},
{
- desc = ' Text',
- group = 'Number',
+ desc = " Text",
+ group = "Number",
--group = "Label",
- action = 'enew',
- key = 't',
+ action = "enew",
+ key = "t",
},
{
- desc = ' Grep',
- group = 'Number',
+ desc = " Grep",
+ group = "Number",
--group = "Label",
- action = 'Telescope live_grep',
- key = 'g',
+ action = "Telescope live_grep",
+ key = "g",
},
{
- desc = ' Scheme',
- group = 'Number',
+ desc = " Scheme",
+ group = "Number",
--group = "Label",
- action = 'Telescope colorscheme',
- key = 's',
+ action = "Telescope colorscheme",
+ key = "s",
},
{
- desc = ' Config',
- group = 'Number',
+ desc = " Config",
+ group = "Number",
--group = "Label",
- action = ':edit ~/.config.nvim/init.lua',
- key = 'c',
+ action = ":edit ~/.config/nvim/init.lua",
+ key = "c",
},
},
- footer = { '', 'Hello World!' },
+ footer = { "", "Hello World!" },
},
hide = {
statusline = false,
diff --git a/.config/nvim/lua/user/func.lua b/.config/nvim/lua/plugins/fzf.lua
index c36d9e2..5675e9f 100644
--- a/.config/nvim/lua/user/func.lua
+++ b/.config/nvim/lua/plugins/fzf.lua
@@ -1,32 +1,4 @@
--vim.cmd([[
--- function RandomColorScheme()
--- let mycolors = split(globpath(&rtp,"**/colors/*.vim"),"\n")
--- exe 'so ' . mycolors[localtime() % len(mycolors)]
--- unlet mycolors
--- endfunction
---
--- call RandomColorScheme()
---
--- :command NewColor call RandomColorScheme()
---]])
-
---vim.cmd([[
--- function RandomColorSchemeMyPicks()
--- let mypicks = ["pyte", "fokus", "github", "peachpuff", "morning", "simple256", "xcode", "gruvbox"]
--- let mypick = mypicks[localtime() % len(mypicks)]
--- echom mypick
--- execute 'colo' mypick
--- endfunction
---
--- command NewColor call RandomColorSchemeMyPicks()
---
--- let s:use_gui = exists('g:neovide') || has('gui_running') || (has('termguicolors') && &termguicolors)
--- if (s:use_gui)
--- call RandomColorSchemeMyPicks()
--- endif
---]])
-
---vim.cmd([[
-- let g:fzf_history_dir = '~/.local/share/fzf-history'
-- map <leader>z :FZF<CR>
-- map <leader>a :Files<CR>
@@ -86,53 +58,3 @@
-- \ fzf#vim#with_preview({'dir': systemlist('git rev-parse --show-toplevel')[0]}), <bang>0)
-- command! -bang FM call fzf#run(fzf#wrap({'source': 'cat ~/.fzf-marks | sed "s/.*: \(.*\)$/\1/" | sed "s#~#${HOME}#"', 'sink': 'lcd'}, <bang>0))
--]])
---
---vim.cmd([[
--- " Enable mouse scrollback
--- set mouse=a
--- tnoremap <Esc> <C-\><C-n>
--- tnoremap <c-b> <c-\><c-n>
--- function! ClearTerminal()
--- set scrollback=1
--- let &g:scrollback=1
--- echo &scrollback
--- call feedkeys("\i")
--- call feedkeys("clear\<CR>")
--- call feedkeys("\<C-\>\<C-n>")
--- call feedkeys("\i")
--- sleep 100m
--- let &scrollback=s:scroll_value
--- endfunction
---]])
---
---vim.cmd([[
--- " :Rename {newname}
--- function! RenameFile()
--- let old_name = expand('%')
--- let new_name = input('New file name: ', expand('%'), 'file')
--- if new_name != '' && new_name != old_name
--- exec ':saveas ' . new_name
--- exec ':silent !rm ' . old_name
--- redraw!
--- endif
--- endfunction
--- map <leader>re :call RenameFile()<cr>
---]])
-
---vim.cmd([[
--- " Markdown Settings
--- autocmd BufNewFile,BufReadPost *.md set filetype=markdown
--- let g:markdown_fenced_languages = ['html', 'python', 'bash=sh', 'sql', 'pug']
--- let g:markdown_minlines = 100
--- let g:instant_markdown_autostart = 0
---]])
---
---vim.cmd([[
--- " On The Fly Table mode
--- function! s:isAtStartOfLine(mapping)
--- let text_before_cursor = getline('.')[0 : col('.')-1]
--- let mapping_pattern = '\V' . escape(a:mapping, '\')
--- let comment_pattern = '\V' . escape(substitute(&l:commentstring, '%s.*$', '', ''), '\')
--- return (text_before_cursor =~? '^' . ('\v(' . comment_pattern . '\v)?') . '\s*\v' . mapping_pattern . '\v$')
--- endfunction
---]])
diff --git a/.config/nvim/lua/plugins/git.lua b/.config/nvim/lua/plugins/git.lua
deleted file mode 100644
index 963f7f9..0000000
--- a/.config/nvim/lua/plugins/git.lua
+++ /dev/null
@@ -1,11 +0,0 @@
-local status, git = pcall(require, "git")
-if (not status) then return end
-
-git.setup({
- keymaps = {
- -- Open blame window
- blame = "<Leader>gb",
- -- Open file/folder in git repository
- browse = "<Leader>go",
- }
-})
diff --git a/.config/nvim/lua/plugins/heirline.lua b/.config/nvim/lua/plugins/heirline.lua
index 0f99de0..a5cd2bf 100644
--- a/.config/nvim/lua/plugins/heirline.lua
+++ b/.config/nvim/lua/plugins/heirline.lua
@@ -95,6 +95,7 @@ local ViMode = {
end,
update = {
'ModeChanged',
+ 'VimEnter',
pattern = '*:*',
callback = vim.schedule_wrap(function()
vim.cmd('redrawstatus')
diff --git a/.config/nvim/lua/plugins/leetcode.lua b/.config/nvim/lua/plugins/leetcode.lua
new file mode 100644
index 0000000..50369e1
--- /dev/null
+++ b/.config/nvim/lua/plugins/leetcode.lua
@@ -0,0 +1,68 @@
+---@alias lc.lang
+---| "cpp"
+---| "java"
+---| "python"
+---| "python3"
+---| "c"
+---| "csharp"
+---| "javascript"
+---| "typescript"
+---| "php"
+---| "swift"
+---| "kotlin"
+---| "dart"
+---| "golang"
+---| "ruby"
+---| "scala"
+---| "rust"
+---| "racket"
+---| "erlang"
+---| "elixir"
+
+---@alias lc.sql_lang
+---| "pythondata"
+---| "mysql"
+---| "mssql"
+---| "oraclesql"
+
+---@alias lc.domain
+---| "com"
+---| "cn"
+
+---@class lc.UserConfig
+local M = {
+ ---@type lc.domain
+ domain = 'com', -- For now "com" is the only one supported
+
+ ---@type string
+ arg = 'leetcode.nvim',
+
+ ---@type lc.lang
+ lang = 'cpp',
+
+ ---@type lc.sql_lang
+ sql = 'mysql',
+
+ ---@type string
+ directory = vim.fn.stdpath('data') .. '/leetcode/',
+
+ ---@type boolean
+ logging = true,
+
+ console = {
+ ---@type boolean
+ open_on_runcode = false,
+
+ size = {
+ width = '75%', ---@type string | integer
+ height = '75%', ---@type string | integer
+ },
+ dir = 'row', ---@type "col" | "row"
+ },
+
+ description = {
+ width = '40%', ---@type string | integer
+ },
+}
+
+return M
diff --git a/.config/nvim/lua/plugins/lsp.lua b/.config/nvim/lua/plugins/lsp.lua
index 92278f3..8884599 100644
--- a/.config/nvim/lua/plugins/lsp.lua
+++ b/.config/nvim/lua/plugins/lsp.lua
@@ -142,10 +142,18 @@ augroup END
on_attach(client)
end
+ local cmp_nvim_lsp = require('cmp_nvim_lsp')
local servers = {
asm_lsp = {},
bashls = {},
- clangd = {},
+ clangd = {
+ on_attach = on_attach,
+ capabilities = cmp_nvim_lsp.default_capabilities(),
+ cmd = {
+ 'clangd',
+ '--offset-encoding=utf-16',
+ },
+ },
cssls = { filetypes = { 'css', 'scss', 'less', 'sass' }, root_dir = lspconfig.util.root_pattern('package.json', '.git') }, -- ghcide = {},
html = {},
jsonls = { prefer_null_ls = true, cmd = { '--stdio' } },
@@ -264,8 +272,10 @@ augroup END
-- }
-- null_ls.setup({
- local sources = { -- Diagnostics
- builtins.diagnostics.chktex, -- null_ls.builtins.code_actions.eslint_d,
+ local sources = {
+ -- Diagnostics
+ builtins.diagnostics.chktex,
+ -- null_ls.builtins.code_actions.eslint_d,
-- null_ls.builtins.diagnostics.eslint_d,
-- null_ls.builtins.formatting.eslint_d,
-- null_ls.builtins.diagnostics.cppcheck,
diff --git a/.config/nvim/lua/plugins/lspsaga.lua b/.config/nvim/lua/plugins/lspsaga.lua
deleted file mode 100644
index 4161ce9..0000000
--- a/.config/nvim/lua/plugins/lspsaga.lua
+++ /dev/null
@@ -1,46 +0,0 @@
-return function()
- local saga = require "lspsaga"
-
- saga.init_lsp_saga {
- use_saga_diagnostic_sign = false,
- finder_action_keys = {
- vsplit = "v",
- split = "s",
- quit = { "q", "<ESC>" },
- },
- code_action_icon = "💡",
- code_action_prompt = {
- enable = false,
- sign = false,
- virtual_text = false,
- },
- }
-
- require("as.highlights").highlight("LspSagaLightbulb", { guifg = "NONE", guibg = "NONE" })
-
--- as.vnoremap("<leader>ca", ":<c-u>lua require('lspsaga.codeaction').range_code_action()<CR>")
--- as.inoremap("<c-k>", "<cmd>lua require('lspsaga.signaturehelp').signature_help()<CR>")
--- as.nnoremap("K", "<cmd>lua require('lspsaga.hover').render_hover_doc()<CR>")
--- -- scroll down hover doc
--- as.nnoremap("<C-f>", "<cmd>lua require('lspsaga.action').smart_scroll_with_saga(1)<CR>")
--- -- scroll up hover doc
--- as.nnoremap("<C-b>", "<cmd>lua require('lspsaga.action').smart_scroll_with_saga(-1)<CR>")
-
- require("which-key").register {
- ["<leader>rn"] = { require("lspsaga.rename").rename, "lsp: rename" },
- ["<leader>ca"] = { require("lspsaga.codeaction").code_action, "lsp: code action" },
- ["gp"] = { require("lspsaga.provider").preview_definition, "lsp: preview definition" },
- ["gh"] = { require("lspsaga.provider").lsp_finder, "lsp: finder" },
- -- jump diagnostic
- ["]c"] = { require("lspsaga.diagnostic").lsp_jump_diagnostic_prev, "lsp: previous diagnostic" },
- ["[c"] = { require("lspsaga.diagnostic").lsp_jump_diagnostic_next, "lsp: next diagnostic" },
- }
-
- -- augroup("LspSagaCursorCommands", {
- -- {
- -- events = { "CursorHold" },
- -- targets = { "*" },
- -- command = "lua require('lspsaga.diagnostic').show_cursor_diagnostics()",
- -- },
- -- })
-end
diff --git a/.config/nvim/lua/plugins/notify.lua b/.config/nvim/lua/plugins/notify.lua
new file mode 100644
index 0000000..dcb496a
--- /dev/null
+++ b/.config/nvim/lua/plugins/notify.lua
@@ -0,0 +1,18 @@
+require('notify').setup({
+ background_colour = '#000000',
+ icons = {
+ ERROR = '',
+ WARN = '',
+ INFO = '',
+ DEBUG = '',
+ TRACE = '✎',
+ },
+})
+
+vim.api.nvim_command('hi default link NotifyERRORBody Normal')
+vim.api.nvim_command('hi default link NotifyWARNBody Normal')
+vim.api.nvim_command('hi default link NotifyINFOBody Normal')
+vim.api.nvim_command('hi default link NotifyDEBUGBody Normal')
+vim.api.nvim_command('hi default link NotifyTRACEBody Normal')
+vim.api.nvim_command('hi default link NotifyLogTime Comment')
+vim.api.nvim_command('hi default link NotifyLogTitle Special')
diff --git a/.config/nvim/lua/plugins/null-ls.lua b/.config/nvim/lua/plugins/null-ls.lua
deleted file mode 100644
index 0ab0af8..0000000
--- a/.config/nvim/lua/plugins/null-ls.lua
+++ /dev/null
@@ -1,173 +0,0 @@
---[[null-ls.]]
---
--- null-language-server i.e. a sort of language server which does not provide any services such as formatting and diagnostics you expect from a language server. Instead it will need to install corresponding external “sources” and then hook these sources into the neovim lsp client through null-ls.
---
-local null_ls = require "null-ls"
-local builtins = null_ls.builtins
-
-local eslint_opts = {
- -- condition = function(utils)
- -- return utils.root_has_file ".eslintrc.js" or utils.root_has_file ".eslintrc" or utils.root_has_file ".eslintrc.json"
- -- end,
- -- diagnostics_format = "#{m} [#{c}]",
- prefer_local = true,
-}
-
-local sources = {
- builtins.formatting.stylua,
- builtins.formatting.shfmt.with({
- filetypes = { "bash", "zsh", "sh" },
- extra_args = { "-i", "2", "-ci" },
- }),
- builtins.formatting.shellharden,
- builtins.formatting.trim_whitespace.with { filetypes = { "tmux", "teal", "zsh" } },
- builtins.formatting.clang_format,
- builtins.formatting.rustfmt,
- builtins.formatting.sql_formatter,
- builtins.formatting.prettierd.with({
- filetypes = { "javascript", "javascriptreact", "typescript", "typescriptreact", "json", "yaml", "markdown", "html", "css", "scss", "less", "graphql", "vue", "svelte" },
- }),
- builtins.formatting.prettier.with({
- -- markdown, html/js formatting
- filetypes = { "javascript", "javascriptreact", "typescript", "typescriptreact", "json", "yaml", "markdown", "html",
- "css", "scss", "less", "graphql", "vue", "svelte" },
- extra_args = { "--single-quote", "--tab-width 4", "--print-width 200" },
- }),
-
- builtins.diagnostics.dotenv_linter,
- builtins.diagnostics.shellcheck.with({
- -- shell script diagnostics
- diagnostic_config = {
- -- see :help vim.diagnostic.config()
- underline = true,
- virtual_text = false,
- signs = true,
- update_in_insert = false,
- severity_sort = true,
- },
- diagnostics_format = "[#{c}] #{m} (#{s})",
- -- this will run every time the source runs,
- -- so you should prefer caching results if possible
- }),
- builtins.diagnostics.eslint_d.with(eslint_opts),
- builtins.diagnostics.todo_comments,
- builtins.diagnostics.vint,
-
- builtins.code_actions.shellcheck, -- shell script code actions
- builtins.code_actions.eslint_d.with(eslint_opts),
- builtins.code_actions.gitsigns,
- builtins.code_actions.gitrebase,
- builtins.hover.dictionary,
- builtins.hover.printenv,
-}
-
-local M = {}
-
-M.setup = function(on_attach)
- local augroup = vim.api.nvim_create_augroup("LspFormatting", {})
-
- null_ls.setup({
- sources = sources,
- debug = false,
- on_attach = function(client, bufnr)
- -- Format on save
-
- if client.supports_method "textDocument/formatting" then
- vim.api.nvim_clear_autocmds { group = augroup, buffer = bufnr }
- vim.api.nvim_create_autocmd("BufWritePre", {
- group = augroup,
- buffer = bufnr,
- callback = function()
- vim.lsp.buf.format()
- end
- })
- end
- end,
- })
-end
-
-return M
-
---require("null-ls").setup({
--- --debug = true,
--- disabled_filetypes = { "PKGBUILD" },
--- timeout_ms = 5000,
--- async = true,
--- debounce = 150,
--- --log = {
--- -- enable = true,
--- -- level = 'warn',
--- -- use_console = 'async',
--- --},
--- update_in_insert = false,
--- --fallback_severity = vim.diagnostic.severity.ERROR,
--- --log_level = "warn",
--- --on_attach = nil,
--- --on_init = nil,
--- --on_exit = nil,
--- sources = {
--- --require("null-ls").builtins.formatting.shfmt, -- shell script formatting
--- require("null-ls").builtins.diagnostics.dotenv_linter,
--- --require("null-ls").builtins.diagnostics.editorconfig_checker,
--- require("null-ls").builtins.formatting.shfmt.with({
--- filetypes = { "bash", "zsh", "sh" },
--- extra_args = { "-i", "2", "-ci" },
--- }),
--- require("null-ls").builtins.formatting.prettier, -- markdown formatting
--- --require("null-ls").builtins.diagnostics.shellcheck, -- shell script diagnostics
--- require("null-ls").builtins.diagnostics.shellcheck.with({
--- diagnostic_config = {
--- -- see :help vim.diagnostic.config()
--- underline = true,
--- virtual_text = false,
--- signs = true,
--- update_in_insert = false,
--- severity_sort = true,
--- },
--- diagnostics_format = "[#{c}] #{m} (#{s})",
--- -- this will run every time the source runs,
--- -- so you should prefer caching results if possible
--- }),
----- require("null-ls").builtins.formatting.stylua, -- lua formatting
----- require("null-ls").builtins.formatting.black,
----- require("null-ls").builtins.formatting.prettierd,
----- require("null-ls").builtins.diagnostics.cspell.with {
----- filetypes = { "python", "rust", "typescript" },
----- },
----- --require("null-ls").builtins.diagnostics.luacheck,
----- --require("null-ls").builtins.diagnostics.eslint,
----- --require("null-ls").builtins.diagnostics.eslint_d,
----- require("null-ls").builtins.diagnostics.mdl,
----- require("null-ls").builtins.diagnostics.vint,
----- require("null-ls").builtins.completion.spell,
----- require("null-ls").builtins.formatting.clang_format,
----- require("null-ls").builtins.formatting.rustfmt,
----- require("null-ls").builtins.formatting.sql_formatter,
----- --require("null-ls").builtins.formatting.google_java_format,
----- require("null-ls").builtins.diagnostics.cppcheck,
--- require("null-ls").builtins.formatting.shellharden,
----- --require("null-ls").builtins.code_actions.eslint_d,
--- require("null-ls").builtins.code_actions.shellcheck, -- shell script code actions
--- require("null-ls").builtins.formatting.clang_format,
--- require("null-ls").builtins.formatting.rustfmt,
--- --require("null-ls").builtins.formatting.beautysh,
--- require("null-ls").builtins.formatting.sql_formatter,
--- require("null-ls").builtins.diagnostics.todo_comments,
--- --require("null-ls").builtins.diagnostics.zsh,
--- require("null-ls").builtins.hover.dictionary,
--- require("null-ls").builtins.hover.printenv,
--- },
--- -- default_timeout = 5000,
--- -- diagnostics_format = '[#{c}] #{m} (#{s})',
--- -- fallback_severity = vim.diagnostic.severity.ERROR,
--- -- log = {
--- -- enable = true,
--- -- level = 'warn',
--- -- use_console = 'async',
--- -- },
--- --on_attach = nil,
--- --on_init = nil,
--- --on_exit = nil,
--- --update_in_insert = false,
--- --update_in_leave = false,
---})
diff --git a/.config/nvim/lua/plugins/nvim-tree.lua b/.config/nvim/lua/plugins/nvim-tree.lua
index cab6f1b..f82a327 100644
--- a/.config/nvim/lua/plugins/nvim-tree.lua
+++ b/.config/nvim/lua/plugins/nvim-tree.lua
@@ -101,7 +101,6 @@ local float = {
local view = {
cursorline = true,
- hide_root_folder = false,
float = float,
--signcolumn = 'no',
width = function()
diff --git a/.config/nvim/lua/plugins/prettier.lua b/.config/nvim/lua/plugins/prettier.lua
deleted file mode 100644
index 05d4665..0000000
--- a/.config/nvim/lua/plugins/prettier.lua
+++ /dev/null
@@ -1,19 +0,0 @@
-local status, prettier = pcall(require, "prettier")
-if (not status) then return end
-
-prettier.setup {
- bin = 'prettierd',
- filetypes = {
- "c",
- "lua",
- "vim",
- --"css",
- --"javascript",
- --"javascriptreact",
- --"typescript",
- --"typescriptreact",
- --"json",
- --"scss",
- "less"
- }
-}
diff --git a/.config/nvim/lua/plugins/scripts/lsp-ext.lua b/.config/nvim/lua/plugins/scripts/lsp-ext.lua
deleted file mode 100644
index c4378c6..0000000
--- a/.config/nvim/lua/plugins/scripts/lsp-ext.lua
+++ /dev/null
@@ -1,48 +0,0 @@
---
--- lsp-ext.lua
-
-
-M = {}
-
-function M.preview_location(location, context, before_context)
- -- location may be LocationLink or Location (more useful for the former)
- context = context or 15
- before_context = before_context or 0
- local uri = location.targetUri or location.uri
- if uri == nil then
- return
- end
- local bufnr = vim.uri_to_bufnr(uri)
- if not vim.api.nvim_buf_is_loaded(bufnr) then
- vim.fn.bufload(bufnr)
- end
- local range = location.targetRange or location.range
- local contents =
- vim.api.nvim_buf_get_lines(bufnr, range.start.line - before_context, range["end"].line + 1 + context, false)
- local filetype = vim.api.nvim_buf_get_option(bufnr, "filetype")
- return vim.lsp.util.open_floating_preview(contents, filetype)
-end
-
-function M.preview_location_callback(_, method, result)
- local context = 15
- if result == nil or vim.tbl_isempty(result) then
- print("No location found: " .. method)
- return nil
- end
- if vim.tbl_islist(result) then
- M.floating_buf, M.floating_win = M.preview_location(result[1], context)
- else
- M.floating_buf, M.floating_win = M.preview_location(result, context)
- end
-end
-
-function M.peek_definition()
- if vim.tbl_contains(vim.api.nvim_list_wins(), M.floating_win) then
- vim.api.nvim_set_current_win(M.floating_win)
- else
- local params = vim.lsp.util.make_position_params()
- return vim.lsp.buf_request(0, "textDocument/definition", params, M.preview_location_callback)
- end
-end
-
-return M
diff --git a/.config/nvim/lua/plugins/scripts/setcolors.lua b/.config/nvim/lua/plugins/scripts/setcolors.lua
deleted file mode 100644
index 605bc84..0000000
--- a/.config/nvim/lua/plugins/scripts/setcolors.lua
+++ /dev/null
@@ -1,121 +0,0 @@
-vim.cmd([[
-" Change the color scheme from a list of color scheme names.
-" Version 2010-09-12 from http://vim.wikia.com/wiki/VimTip341
-" Press key:
-" F8 next scheme
-" Shift-F8 previous scheme
-" Alt-F8 random scheme
-" Set the list of color schemes used by the above (default is 'all'):
-" :SetColors all (all $VIMRUNTIME/colors/*.vim)
-" :SetColors my (names built into script)
-" :SetColors blue ayu ron (these schemes)
-" :SetColors (display current scheme names)
-" Set the current color scheme based on time of day:
-" :SetColors now
-if v:version < 700 || exists('loaded_setcolors') || &cp
- finish
-endif
-
-let loaded_setcolors = 1
-let s:mycolors = ['everblush', 'ayu', 'gruvbox', 'molokai', 'onedark', 'srcery'] " colorscheme names that we use to set color
-
-" Set list of color scheme names that we will use, except
-" argument 'now' actually changes the current color scheme.
-function! s:SetColors(args)
- if len(a:args) == 0
- echo 'Current color scheme names:'
- let i = 0
- while i < len(s:mycolors)
- echo ' '.join(map(s:mycolors[i : i+4], 'printf("%-14s", v:val)'))
- let i += 5
- endwhile
- elseif a:args == 'all'
- let paths = split(globpath(&runtimepath, 'colors/*.vim'), "\n")
- let s:mycolors = uniq(sort(map(paths, 'fnamemodify(v:val, ":t:r")')))
- echo 'List of colors set from all installed color schemes'
- elseif a:args == 'my'
- let c1 = 'default srcery everblush'
- let c2 = 'gruvbox onedark'
- let c3 = 'ayu molokai'
- let s:mycolors = split(c1.' '.c2.' '.c3)
- echo 'List of colors set from built-in names'
- elseif a:args == 'now'
- call s:HourColor()
- else
- let s:mycolors = split(a:args)
- echo 'List of colors set from argument (space-separated names)'
- endif
-endfunction
-
-command! -nargs=* SetColors call s:SetColors('<args>')
-
-" Set next/previous/random (how = 1/-1/0) color from our list of colors.
-" The 'random' index is actually set from the current time in seconds.
-" Global (no 's:') so can easily call from command line.
-function! NextColor(how)
- call s:NextColor(a:how, 1)
-endfunction
-
-" Helper function for NextColor(), allows echoing of the color name to be
-" disabled.
-function! s:NextColor(how, echo_color)
- if len(s:mycolors) == 0
- call s:SetColors('all')
- endif
- if exists('g:colors_name')
- let current = index(s:mycolors, g:colors_name)
- else
- let current = -1
- endif
- let missing = []
- let how = a:how
- for i in range(len(s:mycolors))
- if how == 0
- let current = localtime() % len(s:mycolors)
- let how = 1 " in case random color does not exist
- else
- let current += how
- if !(0 <= current && current < len(s:mycolors))
- let current = (how>0 ? 0 : len(s:mycolors)-1)
- endif
- endif
- try
- execute 'colorscheme '.s:mycolors[current]
- break
- catch /E185:/
- call add(missing, s:mycolors[current])
- endtry
- endfor
- redraw
- if len(missing) > 0
- echo 'Error: colorscheme not found:' join(missing)
- endif
- if (a:echo_color)
- echo g:colors_name
- endif
-endfunction
-
-nnoremap <leader>cn :call NextColor(1)<CR>
-nnoremap <leader>cp :call NextColor(-1)<CR>
-nnoremap <leader>cc :call NextColor(0)<CR>
-
-" Set color scheme according to current time of day.
-function! s:HourColor()
- let hr = str2nr(strftime('%H'))
- if hr <= 3
- let i = 0
- elseif hr <= 7
- let i = 1
- elseif hr <= 14
- let i = 2
- elseif hr <= 18
- let i = 3
- else
- let i = 4
- endif
- let nowcolors = 'srcery onedark molokai'
- execute 'colorscheme '.split(nowcolors)[i]
- redraw
- echo g:colors_name
-endfunction
-]])
diff --git a/.config/nvim/lua/plugins/scripts/toggleLsp.lua b/.config/nvim/lua/plugins/scripts/toggleLsp.lua
deleted file mode 100644
index 28af698..0000000
--- a/.config/nvim/lua/plugins/scripts/toggleLsp.lua
+++ /dev/null
@@ -1,40 +0,0 @@
-local M = {}
-
-local check_function = function(bufnr, _)
- local ok, result = pcall(vim.api.nvim_buf_get_var, bufnr, 'lsp_enabled')
- -- No buffer local variable set, so just enable by default
- if not ok then
- return true
- end
-
- return result
-end
-
-vim.lsp.handlers["textDocument/publishDiagnostics"] =
- vim.lsp.with(vim.lsp.diagnostic.on_publish_diagnostics, {
- underline = check_function,
- virtual_text = check_function,
- signs = check_function
- })
-
-function M.Enable()
- vim.b.lsp_enabled = true
-end
-
-function M.Disable()
- vim.b.lsp_enabled = false
-end
-
-function M.Toggle()
- if vim.b.lsp_enabled == false then
- M.Enable()
- else
- M.Disable()
- end
-end
-
-vim.cmd [[
- command! -nargs=* ToggleLsp lua require'lsp.toggle'.Toggle()
-]]
-
-return M
diff --git a/.config/nvim/lua/plugins/telescope.lua b/.config/nvim/lua/plugins/telescope.lua
index 0167aa3..cf0864a 100644
--- a/.config/nvim/lua/plugins/telescope.lua
+++ b/.config/nvim/lua/plugins/telescope.lua
@@ -340,6 +340,7 @@ function M.find_configs()
'~/.prettierrc.yml',
'~/.ssh',
'~/README.md',
+ '~/.config/inputrc',
},
file_ignore_patterns = {
'/nvim/startup.log',
@@ -391,7 +392,7 @@ function M.find_projects()
local search_dir = '~/projects'
pickers
.new({}, {
- prompt_title = 'Change Directory',
+ prompt_title = 'Find Projects',
finder = finders.new_oneshot_job({
'find',
vim.fn.expand(search_dir),
@@ -450,26 +451,49 @@ function M.find_notes()
end
function M.find_books()
- require('telescope.builtin').find_files({
- hidden = true,
- no_ignore = false,
- prompt_title = ' Find Books',
- path_display = { 'smart' },
- search_dirs = {
- '~/documents/books',
- '~/books',
- },
- layout_strategy = 'horizontal',
- layout_config = { preview_width = 0.65, width = 0.75 },
- })
-end
+ local search_dir = '~/documents/books'
-function M.file_explorer()
- require('telescope.builtin').file_browser({
- prompt_title = 'File Browser',
- cwd = '~',
- layout_strategy = 'horizontal',
- })
+ pickers
+ .new({}, {
+ prompt_title = 'Find Books',
+ finder = finders.new_oneshot_job({
+ 'find',
+ vim.fn.expand(search_dir),
+ '-type',
+ 'd',
+ '-o',
+ '-type',
+ 'f',
+ '-maxdepth',
+ '1',
+ }),
+ previewer = require('telescope.previewers').vim_buffer_cat.new({}),
+ sorter = config.generic_sorter({}),
+ attach_mappings = function(prompt_bufnr, map)
+ actions_set.select:replace(function()
+ local entry = actions_state.get_selected_entry()
+ if entry ~= nil then
+ local path = entry.value
+ actions.close(prompt_bufnr, false)
+
+ -- Determine whether it's a directory or a file
+ local is_directory = vim.fn.isdirectory(path)
+
+ if is_directory then
+ -- It's a directory, navigate to it
+ vim.fn.chdir(path)
+ vim.cmd('e .')
+ print('Selected directory: ' .. path)
+ else
+ -- It's a file, do something with it (open it, for example)
+ print('Selected file: ' .. path)
+ end
+ end
+ end)
+ return true
+ end,
+ })
+ :find()
end
function M.grep_current_dir()
diff --git a/.config/nvim/lua/user/keys.lua b/.config/nvim/lua/user/keys.lua
index ebafd21..d97d86d 100644
--- a/.config/nvim/lua/user/keys.lua
+++ b/.config/nvim/lua/user/keys.lua
@@ -138,6 +138,9 @@ map('n', '<leader>vt', '<Cmd>call utils#VerboseToggle()<CR>')
-- Jump List
map('n', '<leader>j', '<Cmd>call utils#GotoJump()<CR>')
+-- Rename file
+map('n', '<leader>rf', '<Cmd>call utils#RenameFile()<CR>')
+
-- Map delete to Ctrl+l
map('i', '<C-l>', '<Del>')
@@ -432,3 +435,6 @@ map('n', '<leader>co', '<CMD>lua require("user.mods").toggleCodi()<CR>')
map('n', '<leader>ss', '<CMD>lua require("user.mods").Scratch("float")<CR>')
map('n', '<leader>sh', '<CMD>lua require("user.mods").Scratch("horizontal")<CR>')
map('n', '<leader>sv', '<CMD>lua require("user.mods").Scratch("vertical")<CR>')
+
+-- Hardtime
+map('n', '<leader>H', ':Hardtime toggle<CR>')
diff --git a/.config/nvim/lua/user/mods.lua b/.config/nvim/lua/user/mods.lua
index 6420ed5..b6431a6 100644
--- a/.config/nvim/lua/user/mods.lua
+++ b/.config/nvim/lua/user/mods.lua
@@ -597,10 +597,12 @@ function M.toggleCodi()
-- Close Codi
vim.cmd('Codi!')
is_codi_open = false
+ print('Codi off')
else
-- Open Codi
vim.cmd('Codi')
is_codi_open = true
+ print('Codi on')
end
end
diff --git a/.config/nvim/lua/user/opts.lua b/.config/nvim/lua/user/opts.lua
index c724710..cc8debc 100644
--- a/.config/nvim/lua/user/opts.lua
+++ b/.config/nvim/lua/user/opts.lua
@@ -18,30 +18,30 @@ vim.opt.clipboard:append({ 'unnamedplus' }) -- Install xclip or this will slowdo
-- Behaviour
vim.opt.backspace = { 'start', 'eol', 'indent' } -- Make backspace work as you would expect.
-vim.opt.hidden = true -- Switch between buffers without having to save first.
-vim.opt.splitbelow = true -- make split put the new buffer below the current buffer
-vim.opt.splitright = true -- make vsplit put the new buffer on the right of the current buffer
-vim.opt.scrolloff = 8 --
-vim.opt.sidescrolloff = 8 -- how many lines to scroll when using the scrollbar
-vim.opt.autoread = true -- reload files if changed externally
-vim.opt.display = 'lastline' -- Show as much as possible of the last line.
-vim.opt.inccommand = 'split' --
-vim.opt.ttyfast = true -- Faster redrawing.
-vim.opt.lazyredraw = false -- Only redraw when necessary
-vim.opt.keywordprg = ':help' -- :help options
-vim.opt.ruler = true --
-vim.opt.errorbells = false --
-vim.opt.list = true -- Show non-printable characters.
-vim.opt.showmatch = true --
-vim.opt.matchtime = 3 --
-vim.opt.showbreak = '↪ ' --
-vim.opt.linebreak = true --
-vim.opt.exrc = true --
+vim.opt.hidden = true -- Switch between buffers without having to save first.
+vim.opt.splitbelow = true -- make split put the new buffer below the current buffer
+vim.opt.splitright = true -- make vsplit put the new buffer on the right of the current buffer
+vim.opt.scrolloff = 8 --
+vim.opt.sidescrolloff = 8 -- how many lines to scroll when using the scrollbar
+vim.opt.autoread = true -- reload files if changed externally
+vim.opt.display = 'lastline' -- Show as much as possible of the last line.
+vim.opt.inccommand = 'split' --
+vim.opt.ttyfast = true -- Faster redrawing.
+vim.opt.lazyredraw = false -- Only redraw when necessary
+vim.opt.keywordprg = ':help' -- :help options
+vim.opt.ruler = true --
+vim.opt.errorbells = false --
+vim.opt.list = true -- Show non-printable characters.
+vim.opt.showmatch = true --
+vim.opt.matchtime = 3 --
+vim.opt.showbreak = '↪ ' --
+vim.opt.linebreak = true --
+vim.opt.exrc = true --
--vim.opt.autochdir = true -- or use this to use <:e> to create a file in current directory
-vim.opt.autoread = true -- if a file is changed outside of vim, automatically reload it without asking
+vim.opt.autoread = true -- if a file is changed outside of vim, automatically reload it without asking
--vim.opt.notimeout = true -- Timeout on keycodes and not mappings
-vim.opt.ttimeout = true -- Makes terminal vim work sanely
-vim.opt.ttimeoutlen = 10 --
+vim.opt.ttimeout = true -- Makes terminal vim work sanely
+vim.opt.ttimeoutlen = 10 --
--vim.opt.timeoutlen = 100 -- time to wait for a mapped sequence to complete (in milliseconds)
--vim.cmd([[set diffopt = vertical = true]]) -- diffs are shown side-by-side not above/below
@@ -179,8 +179,8 @@ vim.opt.fillchars = {
}
vim.opt.listchars = { tab = '▸ ', trail = '·' } --
--vim.opt.fillchars:append({ eob = " " }) -- remove the ~ from end of buffer
-vim.opt.modeline = true --
-vim.opt.modelines = 3 -- modelines (comments that set vim options on a per-file basis)
+vim.opt.modeline = true --
+vim.opt.modelines = 3 -- modelines (comments that set vim options on a per-file basis)
--vim.opt.modelineexpr = true
--vim.opt.nofoldenable = true -- turn folding off
--vim.opt.foldenable = false -- turn folding off
@@ -192,7 +192,7 @@ vim.opt.hlsearch = true -- Keep matches highlighted.
vim.opt.ignorecase = true -- ignore case in search patterns UNLESS /C or capital in search
vim.opt.smartcase = true -- smart case
vim.opt.synmaxcol = 200 -- Only highlight the first 200 columns.
-vim.opt.winblend = 30
+--vim.opt.winblend = 30
--vim.opt.winblend = 5
vim.opt.wildoptions = 'pum' --
--vim.opt.pumblend = 5 --
@@ -301,3 +301,51 @@ vim.cmd([[ " Return to the same line when
\ endif
augroup END
]])
+
+-- Enable mouse scrollback
+vim.cmd([[
+ set mouse=a
+ tnoremap <Esc> <C-\><C-n>
+ tnoremap <c-b> <c-\><c-n>
+ function! ClearTerminal()
+ set scrollback=1
+ let &g:scrollback=1
+ echo &scrollback
+ call feedkeys("\i")
+ call feedkeys("clear\<CR>")
+ call feedkeys("\<C-\>\<C-n>")
+ call feedkeys("\i")
+ sleep 100m
+ let &scrollback=s:scroll_value
+ endfunction
+]])
+
+-- Yank to clipboard in Termux
+if vim.fn.has('termux') == 1 then
+ local Job = require('plenary.job')
+ vim.api.nvim_create_autocmd('TextYankPost', {
+ pattern = '*',
+ callback = function()
+ Job:new({
+ command = 'termux-clipboard-set',
+ writer = vim.fn.getreg('@'),
+ }):start()
+ end,
+ })
+end
+
+function GetTermuxClipboard()
+ if vim.fn.has('termux') == 1 then
+ local sysclip = vim.fn.system('termux-clipboard-get')
+ if sysclip ~= '@' then
+ vim.fn.setreg('@', sysclip)
+ end
+ end
+ return ''
+end
+
+if vim.fn.has('termux') == 1 then
+ vim.cmd('autocmd TextYankPost * call GetTermuxClipboard()')
+ vim.cmd('noremap <expr> p Paste("p")')
+ vim.cmd('noremap <expr> P Paste("P")')
+end
diff --git a/.config/nvim/lua/user/pack.lua b/.config/nvim/lua/user/pack.lua
index 2f3e1e8..3cd66c0 100644
--- a/.config/nvim/lua/user/pack.lua
+++ b/.config/nvim/lua/user/pack.lua
@@ -236,6 +236,19 @@ return packer.startup(function(use)
},
},
})
+ use('kawre/leetcode.nvim')
+ use({
+ 'm4xshen/hardtime.nvim',
+ config = function()
+ require('hardtime').setup()
+ end,
+ })
+ use({
+ 'luckasRanarison/nvim-devdocs',
+ config = function()
+ require('nvim-devdocs').setup()
+ end,
+ })
-- Colorschemes
use('bluz71/vim-nightfly-guicolors')
@@ -298,6 +311,7 @@ return packer.startup(function(use)
})
end,
})
+ use('MunifTanjim/nui.nvim')
use({
'j-hui/fidget.nvim',
tag = 'legacy',
@@ -354,7 +368,7 @@ return packer.startup(function(use)
run = function()
vim.fn['mkdp#util#install']()
end,
- vim.cmd("let g:mkdp_auto_close = 0"),
+ vim.cmd('let g:mkdp_auto_close = 0'),
})
use({
'ellisonleao/glow.nvim', -- Markdown Preview
diff --git a/.config/nvim/lua/user/view.lua b/.config/nvim/lua/user/view.lua
new file mode 100644
index 0000000..50cea8c
--- /dev/null
+++ b/.config/nvim/lua/user/view.lua
@@ -0,0 +1,68 @@
+-- Colorscheme
+
+-- Colors
+vim.opt.termguicolors = true
+
+-- Available colorschemes:
+-- [[ nightfly ayu onedark doom-one nvimgelion github_dark tokyonight ]]
+
+require('tokyonight').setup({
+ style = 'night',
+ transparent = true,
+ transparent_sidebar = true,
+ styles = {
+ sidebars = 'transparent',
+ floats = 'transparent',
+ },
+})
+
+-- Define default color scheme
+local default_colorscheme = 'tokyonight'
+local fallback_colorscheme = 'desert'
+
+-- Attempt to set the default color scheme
+local status_ok, _ = pcall(vim.cmd, 'colorscheme ' .. default_colorscheme)
+
+-- If the default color scheme is not found, use the fallback color scheme
+if not status_ok then
+ vim.cmd('colorscheme ' .. fallback_colorscheme)
+end
+
+vim.api.nvim_command('syntax on')
+vim.api.nvim_command('highlight Normal guibg=NONE ctermbg=NONE')
+vim.api.nvim_command('highlight NormalNC guibg=NONE')
+vim.api.nvim_command('highlight NormalFloat guibg=NONE ctermbg=NONE')
+vim.api.nvim_command('highlight Float guibg=NONE ctermbg=NONE')
+vim.api.nvim_command('highlight NonText guibg=NONE ctermbg=NONE')
+vim.api.nvim_command('highlight SignColumn guibg=NONE')
+vim.api.nvim_command('highlight FoldColumn guibg=NONE')
+vim.api.nvim_command('highlight CursorLineSign guibg=NONE ctermbg=NONE')
+vim.api.nvim_command('highlight Title guibg=NONE gui=bold')
+vim.api.nvim_command('highlight TabLine guibg=#333842 gui=bold')
+vim.api.nvim_command('highlight TabLineSel guibg=#333842 gui=bold')
+vim.api.nvim_command('highlight TabLineFill guibg=NONE gui=bold')
+vim.api.nvim_command('highlight WinBar guibg=NONE ctermbg=NONE gui=bold')
+vim.api.nvim_command('highlight WinBarNC guibg=NONE ctermbg=NONE')
+vim.api.nvim_command('highlight LineNr guibg=NONE ctermbg=NONE')
+vim.api.nvim_command('highlight WinSeparator guibg=NONE gui=bold ctermbg=NONE')
+vim.api.nvim_command('highlight MsgSeparator guibg=NONE ctermbg=NONE')
+vim.api.nvim_command('highlight EndOfBuffer guibg=NONE guifg=Normal')
+vim.api.nvim_command('highlight Comment guibg=NONE ctermbg=NONE')
+vim.api.nvim_command('highlight Winblend guibg=NONE ctermbg=NONE')
+vim.api.nvim_command('highlight NormalFloat guibg=NONE ctermbg=NONE')
+vim.api.nvim_command('highlight Pumblend guibg=NONE ctermbg=NONE')
+vim.api.nvim_command('highlight WildMenu guibg=NONE ctermbg=NONE')
+vim.api.nvim_command('highlight WarningMsg guibg=NONE ctermbg=NONE')
+vim.api.nvim_command('highlight Pmenu guibg=NONE ctermbg=NONE')
+vim.api.nvim_command('highlight PmenuSel guibg=NONE ctermbg=NONE')
+vim.api.nvim_command('highlight PmenuThumb guibg=NONE ctermbg=NONE')
+vim.api.nvim_command('highlight PmenuSbar guibg=NONE ctermbg=NONE')
+vim.api.nvim_command('highlight PmenuExtra guibg=NONE ctermbg=NONE')
+vim.api.nvim_command('highlight PmenuExtraSel guibg=NONE ctermbg=NONE')
+vim.api.nvim_command('highlight MoreMsg guibg=NONE ctermbg=NONE')
+
+-- Set different window separator colorscheme
+vim.cmd([[
+au WinEnter * setl winhl=WinSeparator:WinSeparatorA
+au WinLeave * setl winhl=WinSeparator:WinSeparator
+]])