Skip to content

Commit

Permalink
fix trouble
Browse files Browse the repository at this point in the history
  • Loading branch information
archibate committed Jun 29, 2024
1 parent bc7dabd commit 8fd0e09
Show file tree
Hide file tree
Showing 9 changed files with 61 additions and 12 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ git clone https://github.com/archibate/vimrc ~/.config/nvim
### 默认启用的语法高亮

```
c,cpp,cmake,lua,python,html,javascript,css,json,bash,regex,markdown,glsl,vimdoc
c,cpp,cmake,lua,python,html,javascript,css,json,bash,regex,markdown,glsl,vim,vimdoc
```

你可以输入 `:TSInstall <language>` 来安装更多语言的语义高亮支持。
Expand Down
5 changes: 3 additions & 2 deletions after/syntax/qf.vim
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ syn match DiagnosticWarn "\<CMake Warning\>"
syn match DiagnosticHint "-- .*$"
" syn match Special "[:()&|<>\-+*\/]"
" syn match Special "[:()&|<>]"
syn match Function "['`][^']\+'"
syn match NonText "\[-W[^\]]\+\]$"
syn match Function "['`][^']\+['’]"
syn match DiagnosticWarn "\[-W[^\]]\+\]$"
syn match NonText "(message):$"
syn match CmpItemMenu "\^\~*"
syn match NonText "\<In file included from \(\/[a-zA-Z0-9\._\-+]\+\)\+:\d\+:$"
Expand All @@ -22,6 +22,7 @@ syn match NonText "\<FAILED: .\+$"
syn match NonText "\<\(\d\+ warnings\?\)\?\(\sand\s\)\?\(\d\+ errors\?\)\? generated\.$"
syn match NonText "\(: \&\& \)\?\/usr\/bin\/\(cmake\|ninja\|g\?cc\|[gc]++\|clang\(++\)\?\)\(-[-a-zA-Z+]\+\)\? .\+$"
syn match NonText "\(g\?cc\|[gc]++\|clang\(++\)\?\)\(-[-a-zA-Z+]\+\)\?: error: linker command failed with exit code \d\+ (use -v to see invocation)"
syn match NonText "\(cc1\(plus\)\?\)\(-[-a-zA-Z+]\+\)\?: .*$"
syn match NonText "/usr/bin/ld\(-[-a-zA-Z+]\+\)\?: "
syn match NonText "\<ninja: build stopped: subcommand failed\.$"
syn match NonText "\<Exited with code \d\+$"
Expand Down
2 changes: 1 addition & 1 deletion compile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ cp -r "$cache"/archvim-build/predownload "$cache"/archvim-release/lua/archvim
rm -rf "$cache"/archvim-release.tar.gz
cd "$cache"/archvim-release
mkdir -p "$cache"/archvim-release/parser
for x in ~/.local/share/nvim/site/pack/packer/start/nvim-treesitter/parser/{c,cpp,cmake,lua,python,html,javascript,css,json,bash,regex,markdown,diff,glsl,vimdoc}.so; do
for x in ~/.local/share/nvim/site/pack/packer/start/nvim-treesitter/parser/{c,cpp,cmake,lua,python,html,javascript,css,json,bash,regex,markdown,diff,glsl,vim,vimdoc}.so; do
cp "$x" "$cache"/archvim-release/parser
done
for x in "$cache"/archvim-release/parser/*.so; do
Expand Down
2 changes: 1 addition & 1 deletion lua/archvim/config/auto-session.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ require("auto-session").setup {
pre_save_cmds = {
-- [[tabdo GPTClose]],
[[tabdo NvimTreeClose]],
[[tabdo TroubleClose]],
[[tabdo cclose]],
-- [[tabdo noautocmd bufdo exec "if &bt == 'terminal' | bdelete | endif"]],
},
post_restore_cmds = {
Expand Down
4 changes: 2 additions & 2 deletions lua/archvim/config/diagflow.lua
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ require('diagflow').setup({
text_align = 'right', -- 'left', 'right'
placement = 'inline', -- 'top', 'inline'
inline_padding_left = 0, -- the padding left when the placement is inline
update_event = { 'DiagnosticChanged', 'BufReadPost' }, -- the event that updates the diagnostics cache
toggle_event = {}, -- if InsertEnter, can toggle the diagnostics on inserts
update_event = { 'DiagnosticChanged', 'BufReadPost', 'BufEnter' }, -- the event that updates the diagnostics cache
toggle_event = { 'InsertEnter', 'InsertLeave' }, -- if InsertEnter, can toggle the diagnostics on inserts
show_sign = false, -- set to true if you want to render the diagnostic sign before the diagnostic message
render_event = { 'DiagnosticChanged', 'CursorMoved' },
border_chars = {
Expand Down
2 changes: 1 addition & 1 deletion lua/archvim/config/nvim-treesitter.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
-------------------------------
require'nvim-treesitter.configs'.setup {
ensure_installed = {"c", "cpp", "cmake", "lua", "python", "html", "javascript", "css", "json", "bash", "regex", "markdown", "diff", "glsl", "vimdoc"},
ensure_installed = {"c", "cpp", "cmake", "lua", "python", "html", "javascript", "css", "json", "bash", "regex", "markdown", "diff", "glsl", "vim", "vimdoc"},
sync_install = false,
highlight = {
enable = true,
Expand Down
42 changes: 41 additions & 1 deletion lua/archvim/config/trouble.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,43 @@
require'trouble'.setup {
icons = os.getenv('NERD_FONTS') ~= nil,
icons = os.getenv('NERD_FONTS') ~= nil and {
indent = {
top = "",
middle = "├╴",
-- last = "└╴",
last = "╰╴",
fold_open = "",
fold_closed = "",
ws = " ",
},
folder_closed = "",
folder_open = "",
kinds = {
Array = "",
Boolean = "󰨙 ",
Class = "",
Constant = "󰏿 ",
Constructor = "",
Enum = "",
EnumMember = "",
Event = "",
Field = "",
File = "",
Function = "󰊕 ",
Interface = "",
Key = "",
Method = "󰊕 ",
Module = "",
Namespace = "󰦮 ",
Null = "",
Number = "󰎠 ",
Object = "",
Operator = "",
Package = "",
Property = "",
String = "",
Struct = "󰆼 ",
TypeParameter = "",
Variable = "󰀫 ",
},
},
}
7 changes: 4 additions & 3 deletions lua/archvim/mappings.lua
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,13 @@ vim.keymap.set({"v", "n", "i"}, "<F18>", function ()
end
end, { noremap = true, expr = true })
vim.keymap.set({"v", "n", "i", "t"}, "<F7>", "<cmd>NvimTreeFindFileToggle<CR>", { silent = true })
vim.keymap.set({"v", "n", "i", "t"}, "<F9>", "<cmd>TroubleToggle<CR>", { silent = true })
vim.keymap.set({"v", "n", "i", "t"}, "<F9>", "<cmd>Trouble diagnostics toggle focus=false filter.buf=0<CR>", { silent = true })
vim.keymap.set({"v", "n", "i", "t"}, "<F21>", "<cmd>Trouble diagnostics toggle focus=false<CR>", { silent = true })
if pcall(require, "cmake-tools") then
vim.keymap.set({"v", "n", "i", "t"}, "<F5>", "<cmd>wa<CR><cmd>if luaeval('require\"cmake-tools\".is_cmake_project()')|call execute('CMakeRun')|else|call execute('TermExec cmd=!!')|endif<CR>", { silent = true })
vim.keymap.set({"v", "n", "i", "t"}, "<F5>", "<cmd>wa<CR><cmd>if luaeval('require\"cmake-tools\".is_cmake_project()')|call execute('CMakeRun')|else|call execute('TermExec cmd=./run.sh')|endif<CR>", { silent = true })
vim.keymap.set({"v", "n", "i", "t"}, "<F17>", "<cmd>wa<CR><cmd>if luaeval('require\"cmake-tools\".is_cmake_project()')|call execute('CMakeStopRunner')|call execute('CMakeStopExecutor')|else|call execute('TermExec cmd=\\<C-c>')|endif<CR>", { silent = true })
else
vim.keymap.set({"v", "n", "i", "t"}, "<F5>", "<cmd>wa<CR><cmd>call execute('TermExec cmd=!!')<CR>", { silent = true })
vim.keymap.set({"v", "n", "i", "t"}, "<F5>", "<cmd>wa<CR><cmd>call execute('TermExec cmd=./run.sh')<CR>", { silent = true })
vim.keymap.set({"v", "n", "i", "t"}, "<F17>", "<cmd>wa<CR><cmd>call execute('TermExec cmd=\\<C-c>')<CR>", { silent = true })
end
vim.keymap.set({"v", "n", "i", "t"}, "<F10>", "<cmd>Neogit<CR><cmd>set foldtext='+'<CR>", { silent = true })
Expand Down
7 changes: 7 additions & 0 deletions lua/archvim/options.lua
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,13 @@ autocmd FileType qf nnoremap <buffer> <F18> <cmd>cclose<CR>
augroup END
]]

vim.cmd [[
augroup trouble_setlocal
autocmd!
autocmd FileType trouble setlocal wrap
augroup END
]]

vim.cmd [[
set termguicolors
colorscheme gruvbox
Expand Down

0 comments on commit 8fd0e09

Please sign in to comment.