From 94381fec9281b8fcfcf3d7cccf60f5c2c19d5ca7 Mon Sep 17 00:00:00 2001 From: glepnir Date: Wed, 4 Dec 2024 19:48:03 +0800 Subject: [PATCH] update --- colors/solarized.lua | 3 ++- lua/core/options.lua | 48 +++++++++++++++++------------------ lua/internal/completion.lua | 2 +- lua/keymap/remap.lua | 3 ++- lua/modules/lsp/config.lua | 1 + lua/modules/tools/config.lua | 3 +-- lua/modules/tools/package.lua | 1 - 7 files changed, 30 insertions(+), 31 deletions(-) diff --git a/colors/solarized.lua b/colors/solarized.lua index 2d11c8d7..e63082fd 100644 --- a/colors/solarized.lua +++ b/colors/solarized.lua @@ -2,7 +2,7 @@ -- violet #6c71c4 local colors = { base04 = '#00202b', - base03 = '#002936', + base03 = '#002838', base02 = '#073642', base01 = '#586e75', base00 = '#657b83', @@ -73,6 +73,7 @@ local function load_solarized() shl('Title', { fg = colors.orange }) shl('WildMenu', { fg = colors.base2, bg = colors.base02, reverse = true }) shl('Folded', { bg = colors.base02, fg = colors.base0 }) + shl('ErrorMsg', { fg = colors.red }) -- Treesitter highlights shl('@function', { fg = colors.blue }) diff --git a/lua/core/options.lua b/lua/core/options.lua index ff568814..81efb6bb 100644 --- a/lua/core/options.lua +++ b/lua/core/options.lua @@ -1,9 +1,9 @@ -local api, opt = vim.api, vim.opt +local opt = vim.opt opt.hidden = true opt.magic = true -opt.virtualedit = 'block' -opt.clipboard = 'unnamedplus' +opt.virtualedit = "block" +opt.clipboard = "unnamedplus" opt.wildignorecase = true opt.swapfile = false @@ -19,9 +19,9 @@ opt.smartcase = true opt.infercase = true opt.cursorline = true -opt.completeopt = 'menu,menuone,noinsert,fuzzy,popup' +opt.completeopt = "menu,menuone,noinsert,fuzzy,popup" opt.showmode = false -opt.shortmess = 'aoOTIcF' +opt.shortmess = "aoOTIcF" opt.scrolloff = 2 opt.sidescrolloff = 5 opt.ruler = false @@ -34,9 +34,7 @@ opt.laststatus = 3 opt.list = true --eol:¬ -opt.listchars = 'tab:» ,nbsp:+,trail:·,extends:→,precedes:←,' -opt.pumblend = 10 -opt.winblend = 0 +opt.listchars = "tab:» ,nbsp:+,trail:·,extends:→,precedes:←," opt.undofile = true opt.smarttab = true @@ -46,29 +44,29 @@ opt.tabstop = 2 opt.shiftwidth = 2 opt.foldlevelstart = 99 -opt.foldmethod = 'marker' +opt.foldmethod = "marker" opt.splitright = true opt.wrap = false opt.number = true -opt.signcolumn = 'yes' -opt.spelloptions = 'camel' +opt.signcolumn = "yes" +opt.spelloptions = "camel" opt.textwidth = 80 -opt.colorcolumn = '+0' +opt.colorcolumn = "+0" -if vim.uv.os_uname().sysname == 'Darwin' then - vim.g.clipboard = { - name = 'macOS-clipboard', - copy = { - ['+'] = 'pbcopy', - ['*'] = 'pbcopy', - }, - paste = { - ['+'] = 'pbpaste', - ['*'] = 'pbpaste', - }, - cache_enabled = 0, - } +if vim.uv.os_uname().sysname == "Darwin" then + vim.g.clipboard = { + name = "macOS-clipboard", + copy = { + ["+"] = "pbcopy", + ["*"] = "pbcopy", + }, + paste = { + ["+"] = "pbpaste", + ["*"] = "pbpaste", + }, + cache_enabled = 0, + } end diff --git a/lua/internal/completion.lua b/lua/internal/completion.lua index cff79d80..36112dc8 100644 --- a/lua/internal/completion.lua +++ b/lua/internal/completion.lua @@ -52,7 +52,7 @@ au('LspAttach', { callback = function(args) local bufnr = args.buf local client = lsp.get_client_by_id(args.data.client_id) - if not client or not client.supports_method('textDocument/completion') then + if not client or not client:supports_method('textDocument/completion') then return end diff --git a/lua/keymap/remap.lua b/lua/keymap/remap.lua index 56d05cf2..cb3bef60 100644 --- a/lua/keymap/remap.lua +++ b/lua/keymap/remap.lua @@ -160,7 +160,7 @@ map.n('gs', function() relative = 'editor', row = 5, width = width, - height = 1, + height = 4, col = math.floor(vim.o.columns / 2) - math.floor(width / 2), border = 'rounded', title = 'Google Search', @@ -170,6 +170,7 @@ map.n('gs', function() vim.wo[winid].number = false vim.wo[winid].stc = '' vim.wo[winid].lcs = 'trail: ' + vim.wo[winid].wrap = true vim.fn.prompt_setcallback(bufnr, function(text) vim.ui.open(('https://google.com/search?q=%s'):format(vim.trim(text))) api.nvim_win_close(winid, true) diff --git a/lua/modules/lsp/config.lua b/lua/modules/lsp/config.lua index b4287a3e..8c7ae2c5 100644 --- a/lua/modules/lsp/config.lua +++ b/lua/modules/lsp/config.lua @@ -89,6 +89,7 @@ local servers = { 'jsonls', 'ts_ls', 'eslint', + 'ruff', -- 'basics_ls', } diff --git a/lua/modules/tools/config.lua b/lua/modules/tools/config.lua index becba816..3b67a656 100644 --- a/lua/modules/tools/config.lua +++ b/lua/modules/tools/config.lua @@ -6,7 +6,6 @@ function config.template_nvim() author = 'glepnir', email = 'glephunter@gmail.com', }) - require('telescope').load_extension('find_template') end function config.guard() @@ -19,7 +18,7 @@ function config.guard() ft('lua'):fmt({ cmd = 'stylua', - args = { '-' }, + args = { '--stdin-filepath', './dummy', '-' }, stdin = true, ignore_patterns = 'function.*_spec%.lua', find = '.stylua.toml', diff --git a/lua/modules/tools/package.lua b/lua/modules/tools/package.lua index 16c86b74..306d365d 100644 --- a/lua/modules/tools/package.lua +++ b/lua/modules/tools/package.lua @@ -10,7 +10,6 @@ packadd({ packadd({ 'nvimdev/guard.nvim', ft = program_ft, - dev = true, config = conf.guard, dependencies = { { 'nvimdev/guard-collection' },