From 0f73cb3fed54b16791cca87271e436b23f62c817 Mon Sep 17 00:00:00 2001 From: Ian Griffin Date: Tue, 24 Jan 2023 12:41:40 +0800 Subject: [PATCH] updates --- colors/borterm.vim | 31 ++++++++++++++ ginit.vim | 13 +++--- init.lua | 4 ++ lua/binds.lua | 13 ++++-- lua/conftool.lua | 5 +++ lua/defs.lua | 8 ++-- lua/ide.lua | 21 ++++----- lua/keys | 104 +++++++++++++++++++++++++++++++++++++++++++++ lua/ui.lua | 44 +++++++++++++++---- 9 files changed, 208 insertions(+), 35 deletions(-) create mode 100755 colors/borterm.vim create mode 100644 lua/keys diff --git a/colors/borterm.vim b/colors/borterm.vim new file mode 100755 index 0000000..706ed7b --- /dev/null +++ b/colors/borterm.vim @@ -0,0 +1,31 @@ +hi clear +set background=light +if exists("syntax_on") + syntax reset +endif +let g:colors_name = "borterm" + +hi Normal ctermfg=8 ctermbg=NONE +hi Comment ctermfg=2 +hi Constant ctermfg=13 +hi String ctermfg=10 +hi Identifier ctermfg=12 cterm=none +hi Statement ctermfg=14 +hi PreProc ctermfg=10 +hi Type ctermfg=14 +hi Special ctermfg=14 +hi Error ctermbg=1 +hi Todo ctermfg=11 ctermbg=11 +hi Directory ctermfg=10 +hi Search ctermbg=11 +hi Number ctermfg=11 +hi Define ctermfg=14 +hi StatusLine ctermfg=7 ctermbg=8 cterm=none +hi StatusLineNC ctermfg=0 ctermbg=15 cterm=none +hi CursorLine ctermbg=15 cterm=none +hi VertSplit ctermfg=0 ctermbg=7 cterm=bold +hi LineNr ctermfg=11 +hi CursorLineNr ctermfg=11 cterm=none +hi Visual ctermbg=15 +hi ColorColumn ctermbg=7 +hi SignColumn ctermbg=NONE diff --git a/ginit.vim b/ginit.vim index 2d7cca3..3f48ea0 100644 --- a/ginit.vim +++ b/ginit.vim @@ -1,10 +1,9 @@ -"" "" Font Setup -"" -Guifont Source\ Code\ Pro:h10 +Guifont SauceCodePro\ Nerd\ Font\ Mono:h10 +"GuiRenderLigatures 1 +GuiScrollBar 1 +GuiTabline 0 -"" "" Colorscheme -"" -set background=light -colo github +set background=dark +set termguicolors diff --git a/init.lua b/init.lua index 4694d23..228df9d 100644 --- a/init.lua +++ b/init.lua @@ -30,6 +30,10 @@ if Packer_bootstrap then packer.sync() end +-- Leader key +vim.g.mapleader = ' ' +vim.g.maplocalleader = ' ' + -- -- Load other files -- diff --git a/lua/binds.lua b/lua/binds.lua index 6f00728..c2990f0 100644 --- a/lua/binds.lua +++ b/lua/binds.lua @@ -8,7 +8,7 @@ local defs = require('defs') -- Maps -- -- select all -ct.map('n', '', 'ggVG') +ct.map('n', 'a', 'ggVG') --[[ -- spawn terminal ct.map('n', '', ':!' .. defs.external_term .. ' . &') @@ -16,11 +16,18 @@ ct.map('n', '', ':!' .. defs.external_term .. ' . &') ct.map('n', '', ':!' .. defs.external_filemgr .. ' . &') ]] -- spellchecking -ct.map('n', '', ':set spell!') +ct.map('n', 's', ':set spell!') + +-- Buffer Navigation +ct.map('n', 'w', ':bnext') +ct.map('n', 'W', ':bprevious') + +-- close buffer +ct.map('n', 'q', ':bd') -- -- Commands -- ct.defcmd('Xrdb', '!xrdb %') ct.defcmd('ExTerm', '!' .. defs.external_term .. '&') -ct.defcmd('ExFileMgr', '!' .. defs.external_filemgr .. '&') +ct.defcmd('ExFileMgr', '!' .. defs.external_filemgr .. '. &') diff --git a/lua/conftool.lua b/lua/conftool.lua index 864a925..f0b0098 100644 --- a/lua/conftool.lua +++ b/lua/conftool.lua @@ -1,5 +1,10 @@ +-- +-- Configuration tools +-- + local conftool = {} +-- a viml-like set function function conftool.set(...) for _,a in ipairs{...} do if type(a) == "string" then diff --git a/lua/defs.lua b/lua/defs.lua index 92c1918..7d69ee6 100644 --- a/lua/defs.lua +++ b/lua/defs.lua @@ -1,8 +1,8 @@ return { - -- Yes, I use the Gnome desktop environment + -- Yes, I use the Mate desktop environment template_dir = '~/templates', - external_term = 'gnome-terminal', - external_filemgr = 'nautilus', - external_pdfviewer = 'evince', + external_term = 'mate-terminal', + external_filemgr = 'caja', + external_pdfviewer = 'atril', lsp_path = vim.env.HOME .. '/.local/share/lsp_servers' } diff --git a/lua/ide.lua b/lua/ide.lua index 5cea9f6..5496e2a 100644 --- a/lua/ide.lua +++ b/lua/ide.lua @@ -56,7 +56,7 @@ pk_use { -- -- Language Configurations -- -pk_use 'ap/vim-css-color' +-- pk_use 'ap/vim-css-color' -- close tags in html languages pk_use { 'alvan/closetag.vim', @@ -67,7 +67,10 @@ pk_use { ft = 'go' } -pk_use 'udalov/kotlin-vim' +pk_use { + 'udalov/kotlin-vim', + ft = 'kotlin' +} -- -- Language Server @@ -80,10 +83,11 @@ pk_use 'nanotee/nvim-lsp-basics' pk_use { 'stevearc/aerial.nvim', config = function() + require('conftool').map('n', 'e', ':AerialToggle') require('aerial').setup({ backends = {'lsp', 'markdown', 'man'}, layout = { - max_width = {25, 0.2} + max_width = 25 } }) end @@ -113,13 +117,6 @@ pk_use { }, config = function() local masonlsp = require 'mason-lspconfig' - masonlsp.setup { - ensure_installed = { - "sumneko_lua", - "gopls", - "vimls" - } - } masonlsp.setup_handlers { function(server_name) require('lspconfig')[server_name].setup(require('coq').lsp_ensure_capabilities { @@ -147,7 +144,7 @@ pk_use { 'folke/trouble.nvim', config = function() require('trouble').setup { - height = 5, + height = 6, icons = false, fold_open = "v", fold_closed = ">", @@ -160,7 +157,7 @@ pk_use { use_diagnostic_signs = false } - require('conftool').map('n', '', ':TroubleToggle') + require('conftool').map('n', 't', ':TroubleToggle') end } diff --git a/lua/keys b/lua/keys new file mode 100644 index 0000000..5234549 --- /dev/null +++ b/lua/keys @@ -0,0 +1,104 @@ + + + +n !> ~/keys +x # * y?\V" + Nvim builtin + Last set from Lua +o % (MatchitOperationForward) + Last set from /usr/share/nvim/runtime/pack/dist/opt/matchit/plugin/matchit.vim line 73 +x % (MatchitVisualForward) + Last set from /usr/share/nvim/runtime/pack/dist/opt/matchit/plugin/matchit.vim line 71 +n % (MatchitNormalForward) + Last set from /usr/share/nvim/runtime/pack/dist/opt/matchit/plugin/matchit.vim line 69 +n & * :&& + Nvim builtin + Last set from Lua +x * * y/\V" + Nvim builtin + Last set from Lua +n > ~/keys +n Y * y$ + Nvim builtin + Last set from Lua +o [% (MatchitOperationMultiBackward) + Last set from /usr/share/nvim/runtime/pack/dist/opt/matchit/plugin/matchit.vim line 81 +x [% (MatchitVisualMultiBackward) + Last set from /usr/share/nvim/runtime/pack/dist/opt/matchit/plugin/matchit.vim line 79 +n [% (MatchitNormalMultiBackward) + Last set from /usr/share/nvim/runtime/pack/dist/opt/matchit/plugin/matchit.vim line 77 +o ]% (MatchitOperationMultiForward) + Last set from /usr/share/nvim/runtime/pack/dist/opt/matchit/plugin/matchit.vim line 82 +x ]% (MatchitVisualMultiForward) + Last set from /usr/share/nvim/runtime/pack/dist/opt/matchit/plugin/matchit.vim line 80 +n ]% (MatchitNormalMultiForward) + Last set from /usr/share/nvim/runtime/pack/dist/opt/matchit/plugin/matchit.vim line 78 +x a% (MatchitVisualTextObject) + Last set from /usr/share/nvim/runtime/pack/dist/opt/matchit/plugin/matchit.vim line 85 +x gx NetrwBrowseXVis + Last set from /usr/share/nvim/runtime/plugin/netrwPlugin.vim line 88 +n gx NetrwBrowseX + Last set from /usr/share/nvim/runtime/plugin/netrwPlugin.vim line 82 +o g% (MatchitOperationBackward) + Last set from /usr/share/nvim/runtime/pack/dist/opt/matchit/plugin/matchit.vim line 74 +x g% (MatchitVisualBackward) + Last set from /usr/share/nvim/runtime/pack/dist/opt/matchit/plugin/matchit.vim line 72 +n g% (MatchitNormalBackward) + Last set from /usr/share/nvim/runtime/pack/dist/opt/matchit/plugin/matchit.vim line 70 +n * lua COQ.Nav_mark() + Last set from API client (channel id 0) +v * lua COQ.Nav_mark() + Last set from API client (channel id 0) +n * i + Last set from API client (channel id 0) +v * i + Last set from API client (channel id 0) + * lua require("packer.load")({'vim-visual-multi'}, { keys = "", prefix = "" }, _G.packer_plugins) + Last set from Lua + * lua require("packer.load")({'vim-visual-multi'}, { keys = "", prefix = "" }, _G.packer_plugins) + Last set from Lua +n * :TroubleToggle + Last set from Lua + GuiTreeviewToggle & :call 26_TreeViewToggle() + Last set from /usr/share/nvim-qt/runtime/plugin/nvim_gui_shim.vim line 221 + GuiTreeviewHide & :call 26_TreeViewShowHide(0) + Last set from /usr/share/nvim-qt/runtime/plugin/nvim_gui_shim.vim line 211 + GuiTreeviewShow & :call 26_TreeViewShowHide(1) + Last set from /usr/share/nvim-qt/runtime/plugin/nvim_gui_shim.vim line 210 +x NetrwBrowseXVis * :call netrw#BrowseXVis() + Last set from /usr/share/nvim/runtime/plugin/netrwPlugin.vim line 90 +n NetrwBrowseX * :call netrw#BrowseX(netrw#GX(),netrw#CheckIfRemote(netrw#GX())) + Last set from /usr/share/nvim/runtime/plugin/netrwPlugin.vim line 84 +x (MatchitVisualTextObject) (MatchitVisualMultiBackward)o(MatchitVisualMultiForward) + Last set from /usr/share/nvim/runtime/pack/dist/opt/matchit/plugin/matchit.vim line 66 +o (MatchitOperationMultiForward) * :call matchit#MultiMatch("W", "o") + Last set from /usr/share/nvim/runtime/pack/dist/opt/matchit/plugin/matchit.vim line 63 +o (MatchitOperationMultiBackward) * :call matchit#MultiMatch("bW", "o") + Last set from /usr/share/nvim/runtime/pack/dist/opt/matchit/plugin/matchit.vim line 62 +x (MatchitVisualMultiForward) * :call matchit#MultiMatch("W", "n")m'gv`` + Last set from /usr/share/nvim/runtime/pack/dist/opt/matchit/plugin/matchit.vim line 61 +x (MatchitVisualMultiBackward) * :call matchit#MultiMatch("bW", "n")m'gv`` + Last set from /usr/share/nvim/runtime/pack/dist/opt/matchit/plugin/matchit.vim line 60 +n (MatchitNormalMultiForward) * :call matchit#MultiMatch("W", "n") + Last set from /usr/share/nvim/runtime/pack/dist/opt/matchit/plugin/matchit.vim line 59 +n (MatchitNormalMultiBackward) * :call matchit#MultiMatch("bW", "n") + Last set from /usr/share/nvim/runtime/pack/dist/opt/matchit/plugin/matchit.vim line 58 +o (MatchitOperationBackward) * :call matchit#Match_wrapper('',0,'o') + Last set from /usr/share/nvim/runtime/pack/dist/opt/matchit/plugin/matchit.vim line 55 +o (MatchitOperationForward) * :call matchit#Match_wrapper('',1,'o') + Last set from /usr/share/nvim/runtime/pack/dist/opt/matchit/plugin/matchit.vim line 54 +x (MatchitVisualBackward) * :call matchit#Match_wrapper('',0,'v')m'gv`` + Last set from /usr/share/nvim/runtime/pack/dist/opt/matchit/plugin/matchit.vim line 53 +x (MatchitVisualForward) * :call matchit#Match_wrapper('',1,'v'):if col("''") != col("$") | exe ":normal! m'" | endifgv`` + Last set from /usr/share/nvim/runtime/pack/dist/opt/matchit/plugin/matchit.vim line 51 +n (MatchitNormalBackward) * :call matchit#Match_wrapper('',0,'n') + Last set from /usr/share/nvim/runtime/pack/dist/opt/matchit/plugin/matchit.vim line 50 +n (MatchitNormalForward) * :call matchit#Match_wrapper('',1,'n') + Last set from /usr/share/nvim/runtime/pack/dist/opt/matchit/plugin/matchit.vim line 49 +n * :set spell! + Last set from Lua +n * ggVG + Last set from Lua +n * nohlsearch|diffupdate|normal! + Nvim builtin + Last set from Lua diff --git a/lua/ui.lua b/lua/ui.lua index 036bb70..4e14280 100644 --- a/lua/ui.lua +++ b/lua/ui.lua @@ -4,16 +4,42 @@ local ct = require 'conftool' -- -- Theme -- -vim.cmd('syntax on') +--vim.cmd('syntax on') +--vim.cmd('colo borterm') pk_use { - 'cormacrelf/vim-colors-github', + 'navarasu/onedark.nvim', setup = function() require('conftool').set({'background', 'dark'}) end, config = function() - vim.cmd [[colo github]] + local theme = require('onedark') + theme.setup { + style = 'darker', + } + theme.load() end } + +-- +-- Buffer Bar +-- +pk_use { + 'romgrk/barbar.nvim', + config = function() + require('bufferline').setup { + animation = false, + auto_hide = true, + icons = false, + icon_separator_active = '|', + icon_separator_inactive = ' ', + icon_close_tab = 'X', + icon_close_tab_modified = '*', + icon_pinned = '!' + + } + end +} + -- -- Indentation -- @@ -35,17 +61,17 @@ pk_use { } -- --- EtC. +-- Misc. -- -ct.set('ruler', 'showcmd', 'cursorline', 'number', 'termguicolors', 'title') +ct.set('ruler', 'showcmd', 'cursorline', 'number', 'title') ct.set( + {'termguicolors', true}, {'signcolumn', 'yes:1'}, - {'laststatus', 1}, - {'background', 'light'}, {'conceallevel', 0}, + {'colorcolumn', '81,121'}, {'textwidth', 0}, - {'wrapmargin', 0}, - {'laststatus', 1} + {'laststatus', 1}, + {'wrapmargin', 0} ) -- dont show line number in terminal window