This commit is contained in:
Ian Griffin 2023-12-28 17:06:53 +08:00
parent 0f73cb3fed
commit 93e008c735
9 changed files with 230 additions and 160 deletions

40
ginit.gtk.vim Normal file
View File

@ -0,0 +1,40 @@
""
"" Misc.
""
set termguicolors
set background=light
hi ColorColumn guibg=#deddda
call rpcnotify(1, 'Gui', 'Option', 'Popupmenu', 0)
call rpcnotify(1, 'Gui', 'Option', 'Tabline', 0)
call rpcnotify(1, 'Gui', 'Command', 'SetCursorBlink', '0')
""
"" Font Setup
""
"" parameters
let s:defaultfontsize = 10
let s:fontname = "Source Code Pro"
"" set default font
:execute "Guifont " . s:fontname . ":h" . s:defaultfontsize
"" increase/decrease font size function
let s:fontsize = s:defaultfontsize
function! AdjustFontSize(amount)
let s:fontsize = s:fontsize+a:amount
:execute "Guifont " . s:fontname . ":h" . s:fontsize
endfunction
"" reset font size
function! ResetFontSize()
:execute "Guifont " . s:fontname . ":h" . s:defaultfontsize
endfunction
"" font size keybindings
noremap <C-S-+> :call AdjustFontSize(1)<CR>
noremap <C-S-_> :call AdjustFontSize(-1)<CR>
noremap <C-S-)> :call ResetFontSize()<CR>
inoremap <C-S-+> <Esc>:call AdjustFontSize(1)<CR>a
inoremap <C-S-_> <Esc>:call AdjustFontSize(-1)<CR>a
inoremap <C-S-)> <Esc>:call ResetFontSize()<CR>a

View File

@ -1,9 +1,47 @@
"" Font Setup
Guifont SauceCodePro\ Nerd\ Font\ Mono:h10
"GuiRenderLigatures 1
GuiScrollBar 1
GuiTabline 0
"" Colorscheme
set background=dark
""
"" Misc.
""
set termguicolors
GuiScrollBar 0
GuiTabline 0
GuiRenderLigatures 0
"" get colorscheme from gtk
let gtk_colorscheme = substitute(system('gsettings get org.gnome.desktop.interface color-scheme'), '\n', '', '')
if gtk_colorscheme == "'prefer-dark'"
set background=dark
else
set background=light
hi ColorColumn guibg=#c0bfbc
endif
""
"" Font Setup
""
"" parameters
let s:defaultfontsize = 10
let s:fontname = "Source Code Pro"
"" set default font
:execute "Guifont " . s:fontname . ":h" . s:defaultfontsize
"" increase/decrease font size function
let s:fontsize = s:defaultfontsize
function! AdjustFontSize(amount)
let s:fontsize = s:fontsize+a:amount
:execute "Guifont " . s:fontname . ":h" . s:fontsize
endfunction
"" reset font size
function! ResetFontSize()
:execute "Guifont " . s:fontname . ":h" . s:defaultfontsize
endfunction
"" font size keybindings
noremap <C-S-+> :call AdjustFontSize(1)<CR>
noremap <C-S-_> :call AdjustFontSize(-1)<CR>
noremap <C-S-)> :call ResetFontSize()<CR>
inoremap <C-S-+> <Esc>:call AdjustFontSize(1)<CR>a
inoremap <C-S-_> <Esc>:call AdjustFontSize(-1)<CR>a
inoremap <C-S-)> <Esc>:call ResetFontSize()<CR>a

View File

@ -28,6 +28,6 @@ ct.map('n', '<Leader>q', ':bd<LF>')
--
-- Commands
--
ct.defcmd('Xrdb', '!xrdb %')
-- ct.defcmd('Xrdb', '!xrdb %')
ct.defcmd('ExTerm', '!' .. defs.external_term .. '&<LF><LF>')
ct.defcmd('ExFileMgr', '!' .. defs.external_filemgr .. '. &<LF><LF>')

View File

@ -1,8 +1,7 @@
return {
-- Yes, I use the Mate desktop environment
template_dir = '~/templates',
external_term = 'mate-terminal',
external_filemgr = 'caja',
external_pdfviewer = 'atril',
external_term = 'kgx',
external_filemgr = 'nautilus',
external_pdfviewer = 'evince',
lsp_path = vim.env.HOME .. '/.local/share/lsp_servers'
}

View File

@ -21,7 +21,14 @@ ct.augroup('templates',
--
ct.augroup('filetypeSettings',
{'FileType', 'python', 'setlocal', 'tabstop=4 shiftwidth=4 expandtab'},
{'FileType', 'html', 'setlocal', 'tabstop=2 shiftwidth=2 expandtab'},
{'FileType', 'javascript', 'setlocal', 'tabstop=2 shiftwidth=2 expandtab'},
{'FileType', 'vue', 'setlocal', 'tabstop=2 shiftwidth=2 expandtab'}
{'FileType', 'html', 'setlocal', 'tabstop=2 shiftwidth=2'},
{'FileType', 'javascript', 'setlocal', 'tabstop=2 shiftwidth=2'},
{'FileType', 'typescript', 'setlocal', 'tabstop=2 shiftwidth=2'},
{'FileType', 'typescriptreact','setlocal', 'tabstop=2 shiftwidth=2'},
{'FileType', 'vue', 'setlocal', 'tabstop=2 shiftwidth=2'}
)
--
-- Misc.
--
vim.cmd 'autocmd BufWritePost *.go,*.py,*.js,*.ts,*tsx,*.tex LspFormat' -- run lspformat when saving in go

View File

@ -8,12 +8,11 @@ local pk_use = require 'packer'.use
--
-- Tree Sitter
--
--[[
pk_use {
'nvim-treesitter/nvim-treesitter',
run = ':TSUpdate',
config = function()
require('nvim-treesitter.configs').setup{
require('nvim-treesitter.configs').setup {
ensure_installed = {
"bash",
"bibtex",
@ -22,11 +21,14 @@ pk_use {
"css",
"go",
"html",
"http",
"javascript",
"json",
"latex",
"lua",
"python",
"typescript",
"tsx",
"vim",
},
sync_install = false,
@ -36,7 +38,6 @@ pk_use {
}
end
}
]]--
--
-- Autocompletion
@ -48,6 +49,7 @@ pk_use {
vim.cmd([[autocmd VimEnter * COQnow -s]])
end
}
pk_use {
'ms-jpq/coq.artifacts',
branch = 'artifacts'
@ -56,22 +58,25 @@ 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',
ft = {"html", "vue"}
}
pk_use {
'fatih/vim-go',
ft = 'go'
ft = { "html", "vue", "typescriptreact" }
}
-- pk_use {
-- 'fatih/vim-go',
-- ft = 'go'
-- }
pk_use {
'udalov/kotlin-vim',
ft = 'kotlin'
}
pk_use 'bellinitte/uxntal.vim'
--
-- Language Server
--
@ -85,9 +90,9 @@ pk_use {
config = function()
require('conftool').map('n', '<Leader>e', ':AerialToggle<LF>')
require('aerial').setup({
backends = {'lsp', 'markdown', 'man'},
backends = { 'lsp', 'markdown', 'man' },
layout = {
max_width = 25
min_width = 25
}
})
end
@ -108,15 +113,30 @@ pk_use {
}
end
}
pk_use {
pk_use {
'williamboman/mason-lspconfig.nvim',
requires = {
'neovim/nvim-lspconfig',
'williamboman/mason.nvim',
'ms-jpq/coq_nvim',
'stevearc/aerial.nvim'
},
config = function()
local masonlsp = require 'mason-lspconfig'
--[[
masonlsp.setup {
ensure_installed = {
"bashls",
"clangd",
"html",
"jsonls",
"lua_ls",
"pyright",
"texlab",
"tsserver"
},
}
--]]
masonlsp.setup_handlers {
function(server_name)
require('lspconfig')[server_name].setup(require('coq').lsp_ensure_capabilities {
@ -125,7 +145,7 @@ pk_use {
basics.make_lsp_commands(client, bufnr)
basics.make_lsp_mappings(client, bufnr)
end
})
})
end
}
end
@ -135,7 +155,7 @@ pk_use {
'neovim/nvim-lspconfig',
config = function()
-- disable inline error messages
vim.diagnostic.config({virtual_text = false})
vim.diagnostic.config({ virtual_text = false })
end
}
@ -161,7 +181,7 @@ pk_use {
end
}
--
--[[
-- Latex Live Preview
--
pk_use {
@ -171,8 +191,21 @@ pk_use {
vim.g.livepreview_previewer = require('defs').external_pdfviewer
vim.g.livepreview_engine = "xelatex"
end
}
}]]
--
-- Markdown Live Preview
--
pk_use {
"iamcco/markdown-preview.nvim",
ft = 'markdown',
run = function()
vim.fn["mkdp#util#install"]()
end,
config = function()
vim.g.mkdp_theme = 'light'
end
}
-- Debugger Adapter Protocol
--[[
@ -185,3 +218,32 @@ pk_use {
}
--]]
--
-- Misc
--
pk_use {
"rest-nvim/rest.nvim",
requires = { "nvim-lua/plenary.nvim" },
config = function()
-- commands
local ct = require('conftool')
ct.defcmd('RestNvim', 'lua require(\'rest-nvim\').run()<CR>')
ct.defcmd('RestNvimPreview', 'lua require(\'rest-nvim\').run(true)<CR>')
ct.defcmd('RestNvimLast', 'lua require(\'rest-nvim\').last()<CR>')
ct.map('n', '<Leader>r', '<Plug>RestNvim<CR>')
ct.map('n', '<Leader>R', '<Plug>RestNvimLast<CR>')
ct.map('n', '<Leader><A-r>', '<Plug>RestNvimPreview<CR>')
require("rest-nvim").setup({
-- Open request results in a horizontal split
result_split_horizontal = true,
-- Keep the http file buffer above|left when split horizontal|vertical
result_split_in_place = true,
result = {
show_curl_command = false,
}
})
end
}

104
lua/keys
View File

@ -1,104 +0,0 @@
n !> ~/keys
x # * y?\V<C-R>"<CR>
Nvim builtin
Last set from Lua
o % <Plug>(MatchitOperationForward)
Last set from /usr/share/nvim/runtime/pack/dist/opt/matchit/plugin/matchit.vim line 73
x % <Plug>(MatchitVisualForward)
Last set from /usr/share/nvim/runtime/pack/dist/opt/matchit/plugin/matchit.vim line 71
n % <Plug>(MatchitNormalForward)
Last set from /usr/share/nvim/runtime/pack/dist/opt/matchit/plugin/matchit.vim line 69
n & * :&&<CR>
Nvim builtin
Last set from Lua
x * * y/\V<C-R>"<CR>
Nvim builtin
Last set from Lua
n > ~/keys
n Y * y$
Nvim builtin
Last set from Lua
o [% <Plug>(MatchitOperationMultiBackward)
Last set from /usr/share/nvim/runtime/pack/dist/opt/matchit/plugin/matchit.vim line 81
x [% <Plug>(MatchitVisualMultiBackward)
Last set from /usr/share/nvim/runtime/pack/dist/opt/matchit/plugin/matchit.vim line 79
n [% <Plug>(MatchitNormalMultiBackward)
Last set from /usr/share/nvim/runtime/pack/dist/opt/matchit/plugin/matchit.vim line 77
o ]% <Plug>(MatchitOperationMultiForward)
Last set from /usr/share/nvim/runtime/pack/dist/opt/matchit/plugin/matchit.vim line 82
x ]% <Plug>(MatchitVisualMultiForward)
Last set from /usr/share/nvim/runtime/pack/dist/opt/matchit/plugin/matchit.vim line 80
n ]% <Plug>(MatchitNormalMultiForward)
Last set from /usr/share/nvim/runtime/pack/dist/opt/matchit/plugin/matchit.vim line 78
x a% <Plug>(MatchitVisualTextObject)
Last set from /usr/share/nvim/runtime/pack/dist/opt/matchit/plugin/matchit.vim line 85
x gx <Plug>NetrwBrowseXVis
Last set from /usr/share/nvim/runtime/plugin/netrwPlugin.vim line 88
n gx <Plug>NetrwBrowseX
Last set from /usr/share/nvim/runtime/plugin/netrwPlugin.vim line 82
o g% <Plug>(MatchitOperationBackward)
Last set from /usr/share/nvim/runtime/pack/dist/opt/matchit/plugin/matchit.vim line 74
x g% <Plug>(MatchitVisualBackward)
Last set from /usr/share/nvim/runtime/pack/dist/opt/matchit/plugin/matchit.vim line 72
n g% <Plug>(MatchitNormalBackward)
Last set from /usr/share/nvim/runtime/pack/dist/opt/matchit/plugin/matchit.vim line 70
n <C-H> * <Cmd>lua COQ.Nav_mark()<CR>
Last set from API client (channel id 0)
v <C-H> * <C-\><C-N><Cmd>lua COQ.Nav_mark()<CR>
Last set from API client (channel id 0)
n <C-Space> * <C-\><C-N>i<C-X><C-U>
Last set from API client (channel id 0)
v <C-Space> * <C-\><C-N>i<C-X><C-U>
Last set from API client (channel id 0)
<C-Down> * <Cmd>lua require("packer.load")({'vim-visual-multi'}, { keys = "<C-Down>", prefix = "" }, _G.packer_plugins)<CR>
Last set from Lua
<C-Up> * <Cmd>lua require("packer.load")({'vim-visual-multi'}, { keys = "<C-Up>", prefix = "" }, _G.packer_plugins)<CR>
Last set from Lua
n <C-S-`> * :TroubleToggle<CR>
Last set from Lua
<Plug>GuiTreeviewToggle & :call <SNR>26_TreeViewToggle()
Last set from /usr/share/nvim-qt/runtime/plugin/nvim_gui_shim.vim line 221
<Plug>GuiTreeviewHide & :call <SNR>26_TreeViewShowHide(0)
Last set from /usr/share/nvim-qt/runtime/plugin/nvim_gui_shim.vim line 211
<Plug>GuiTreeviewShow & :call <SNR>26_TreeViewShowHide(1)
Last set from /usr/share/nvim-qt/runtime/plugin/nvim_gui_shim.vim line 210
x <Plug>NetrwBrowseXVis * :<C-U>call netrw#BrowseXVis()<CR>
Last set from /usr/share/nvim/runtime/plugin/netrwPlugin.vim line 90
n <Plug>NetrwBrowseX * :call netrw#BrowseX(netrw#GX(),netrw#CheckIfRemote(netrw#GX()))<CR>
Last set from /usr/share/nvim/runtime/plugin/netrwPlugin.vim line 84
x <Plug>(MatchitVisualTextObject) <Plug>(MatchitVisualMultiBackward)o<Plug>(MatchitVisualMultiForward)
Last set from /usr/share/nvim/runtime/pack/dist/opt/matchit/plugin/matchit.vim line 66
o <Plug>(MatchitOperationMultiForward) * :<C-U>call matchit#MultiMatch("W", "o")<CR>
Last set from /usr/share/nvim/runtime/pack/dist/opt/matchit/plugin/matchit.vim line 63
o <Plug>(MatchitOperationMultiBackward) * :<C-U>call matchit#MultiMatch("bW", "o")<CR>
Last set from /usr/share/nvim/runtime/pack/dist/opt/matchit/plugin/matchit.vim line 62
x <Plug>(MatchitVisualMultiForward) * :<C-U>call matchit#MultiMatch("W", "n")<CR>m'gv``
Last set from /usr/share/nvim/runtime/pack/dist/opt/matchit/plugin/matchit.vim line 61
x <Plug>(MatchitVisualMultiBackward) * :<C-U>call matchit#MultiMatch("bW", "n")<CR>m'gv``
Last set from /usr/share/nvim/runtime/pack/dist/opt/matchit/plugin/matchit.vim line 60
n <Plug>(MatchitNormalMultiForward) * :<C-U>call matchit#MultiMatch("W", "n")<CR>
Last set from /usr/share/nvim/runtime/pack/dist/opt/matchit/plugin/matchit.vim line 59
n <Plug>(MatchitNormalMultiBackward) * :<C-U>call matchit#MultiMatch("bW", "n")<CR>
Last set from /usr/share/nvim/runtime/pack/dist/opt/matchit/plugin/matchit.vim line 58
o <Plug>(MatchitOperationBackward) * :<C-U>call matchit#Match_wrapper('',0,'o')<CR>
Last set from /usr/share/nvim/runtime/pack/dist/opt/matchit/plugin/matchit.vim line 55
o <Plug>(MatchitOperationForward) * :<C-U>call matchit#Match_wrapper('',1,'o')<CR>
Last set from /usr/share/nvim/runtime/pack/dist/opt/matchit/plugin/matchit.vim line 54
x <Plug>(MatchitVisualBackward) * :<C-U>call matchit#Match_wrapper('',0,'v')<CR>m'gv``
Last set from /usr/share/nvim/runtime/pack/dist/opt/matchit/plugin/matchit.vim line 53
x <Plug>(MatchitVisualForward) * :<C-U>call matchit#Match_wrapper('',1,'v')<CR>:if col("''") != col("$") | exe ":normal! m'" | endif<CR>gv``
Last set from /usr/share/nvim/runtime/pack/dist/opt/matchit/plugin/matchit.vim line 51
n <Plug>(MatchitNormalBackward) * :<C-U>call matchit#Match_wrapper('',0,'n')<CR>
Last set from /usr/share/nvim/runtime/pack/dist/opt/matchit/plugin/matchit.vim line 50
n <Plug>(MatchitNormalForward) * :<C-U>call matchit#Match_wrapper('',1,'n')<CR>
Last set from /usr/share/nvim/runtime/pack/dist/opt/matchit/plugin/matchit.vim line 49
n <C-S> * :set spell!<NL>
Last set from Lua
n <C-A> * <Esc>ggVG<NL>
Last set from Lua
n <C-L> * <Cmd>nohlsearch|diffupdate|normal! <C-L><CR>
Nvim builtin
Last set from Lua

View File

@ -57,6 +57,7 @@ vim.g.netrw_chgwin = 1
--
-- EtC.
--
vim.opt.clipboard = "unnamedplus"
vim.opt.compatible = false
vim.opt.autowrite = true
vim.opt.foldmethod = "marker"
@ -66,5 +67,3 @@ vim.cmd('autocmd BufEnter * silent! lcd %:p:h')
vim.g.markdown_fenced_languages = {'html', 'vim', 'python', 'c', 'bash=sh'}
-- auto close delimiters (eg. parentheses, brackets)
pk_use 'Raimondi/delimitMate'

View File

@ -4,41 +4,63 @@ local ct = require 'conftool'
--
-- Theme
--
--vim.cmd('syntax on')
--vim.cmd('colo borterm')
pk_use {
'navarasu/onedark.nvim',
setup = function()
require('conftool').set({'background', 'dark'})
end,
'Mofiqul/adwaita.nvim',
config = function()
local theme = require('onedark')
theme.setup {
style = 'darker',
}
theme.load()
local ct = require('conftool')
ct.set({'background', 'dark'})
-- vim.g.adwaita_darker = true
vim.cmd [[colo adwaita]]
vim.keymap.set(
'n',
'<Leader>c',
function()
if vim.o.background == 'light' then
vim.o.background = 'dark'
else
vim.o.background = 'light'
vim.api.nvim_set_hl(0, 'ColorColumn', {bg = '#c0bfbc'})
vim.cmd('redraw')
vim.cmd('redraw')
end
end,
{noremap = true}
)
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 = '!'
icons = {
filetype = {
custom_colors = false,
enabled = false
},
inactive = {left = ' '},
modified = {button = '*'},
-- separator = {left = '|'},
pinned = {button = '!'},
button = 'X'
},
sidebar_filetypes = {
aerial = true,
netrw = true
}
}
end
}
--]]
--
-- Indentation
@ -51,12 +73,14 @@ ct.set({'tabstop', 5}, {'shiftwidth', 5})
-- Indent indicators
--
vim.opt.list = true
vim.cmd([[set lcs=tab:\|\ ]])
--vim.cmd([[set lcs=tab:\|\ ]])
pk_use {
'Yggdroot/indentLine',
'nathanaelkane/vim-indent-guides',
setup = function()
vim.g.indentLine_char = '|'
vim.g.indentLine_setConceal = 0
vim.g.indent_guides_guide_size = 1
vim.g.indent_guides_tab_guides = 0
vim.g.indent_guides_start_level = 2
vim.g.indent_guides_enable_on_vim_startup = 1
end
}
@ -74,6 +98,11 @@ ct.set(
{'wrapmargin', 0}
)
-- Rainbow Delimiters
pk_use {
'hiphish/rainbow-delimiters.nvim',
}
-- dont show line number in terminal window
vim.cmd('autocmd TermOpen * setlocal nonu')
-- turn on mouse