Skip to content

Commit

Permalink
[feat] update plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
linuxing3 committed Dec 24, 2023
1 parent a144ea6 commit 5d9563f
Show file tree
Hide file tree
Showing 9 changed files with 149 additions and 104 deletions.
1 change: 1 addition & 0 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Version 2.0, January 2004
http://www.apache.org/licenses/


TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION

1. Definitions.
Expand Down
22 changes: 21 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,24 @@
# 💤 LazyVim

A starter template for [LazyVim](https://github.com/LazyVim/LazyVim).
Refer to the [documentation](https://lazyvim.github.io/installation) to get started.
Refer to the [documentation](https://lazyvim.github.io/installation) to get stopped.

## Installed packages

## LSP

- clangd
- rust-analyzer
- node
- cmake
- dockerfile
- go
- pyright
- zls
- sumneko-lua

## Formatter

## Linter

## Command
6 changes: 6 additions & 0 deletions autoload/helper.lua
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
local util = require("lspconfig.util")

vim.cmd([[
iabbrev #b /****************************************
iabbrev #e <Space>****************************************/
abbreviate teh the
]])
175 changes: 89 additions & 86 deletions lazy-lock.json

Large diffs are not rendered by default.

9 changes: 9 additions & 0 deletions lazyvim.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"extras": [

],
"news": {
"NEWS.md": "2123"
},
"version": 2
}
15 changes: 5 additions & 10 deletions lua/config/autocmds.lua
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ function autocmd.load_autocmds()
-- "BufWritePost",
-- "~/workspace/cxx/**/build.justfile ! just -f '%' -d . '%:p:h'",
-- },
{
"BufWritePost",
"xmake.lua",
"xmake project -k compile_commands",
},
-- {
-- "BufWritePost",
-- "xmake.lua",
-- "xmake project -k compile_commands",
-- },
{
"BufWritePost",
"Cargo.toml !cargo check",
Expand Down Expand Up @@ -85,11 +85,6 @@ function autocmd.load_autocmds()
"*",
[[if winnr('$') == 1 && bufname() == 'NvimTree_' . tabpagenr() | quit | endif]],
},
-- Auto toggle fcitx5
-- {"InsertLeave", "* :silent", "!fcitx5-remote -c"},
-- {"BufCreate", "*", ":silent !fcitx5-remote -c"},
-- {"BufEnter", "*", ":silent !fcitx5-remote -c "},
-- {"BufLeave", "*", ":silent !fcitx5-remote -c "}
},
wins = {
-- Highlight current line only on focused window
Expand Down
14 changes: 7 additions & 7 deletions lua/config/keymaps.lua
Original file line number Diff line number Diff line change
Expand Up @@ -178,20 +178,21 @@ end
-- stylua: ignore start

-- toggle options
map("n", "<leader>uf", require("lazyvim.plugins.lsp.format").toggle, { desc = "Toggle format on Save" })
map("n", "<leader>uf", function() Util.toggle("format") end, { desc = "Toggle format on Save" })
map("n", "<leader>us", function() Util.toggle("spell") end, { desc = "Toggle Spelling" })
map("n", "<leader>uw", function() Util.toggle("wrap") end, { desc = "Toggle Word Wrap" })
map("n", "<leader>ul", function() Util.toggle("relativenumber", true) Util.toggle("number") end, { desc = "Toggle Line Numbers" })
map("n", "<leader>ud", Util.toggle_diagnostics, { desc = "Toggle Diagnostics" })
map("n", "<leader>ud", function ()
Util.toggle("diagnostics")
end, { desc = "Toggle Diagnostics" })
local conceallevel = vim.o.conceallevel > 0 and vim.o.conceallevel or 3
map("n", "<leader>uc", function() Util.toggle("conceallevel", false, {0, conceallevel}) end, { desc = "Toggle Conceal" })
if vim.lsp.inlay_hint then
map("n", "<leader>uh", function() vim.lsp.inlay_hint(0, nil) end, { desc = "Toggle Inlay Hints" })
end

-- lazygit
map("n", "<leader>gg", function() Util.float_term({ "lazygit" }, { cwd = Util.get_root(), esc_esc = false, ctrl_hjkl = false }) end, { desc = "Lazygit (root dir)" })
map("n", "<leader>gG", function() Util.float_term({ "lazygit" }, {esc_esc = false, ctrl_hjkl = false}) end, { desc = "Lazygit (cwd)" })
map("n", "<leader>gg", function() Util.terminal.open("lazygit", { cwd = Util.root.get(), esc_esc = false, ctrl_hjkl = false, float = { border = "rounded"}}) end, { desc = "Lazygit (root dir)" })

-- quit
map("n", "<leader>qq", "<cmd>qa!<cr>", { desc = "Quit all" })
Expand All @@ -203,10 +204,9 @@ if vim.fn.has("nvim-0.9.0") == 1 then
end

-- floating terminal
local lazyterm = function() Util.float_term(nil, { cwd = Util.get_root() }) end
local lazyterm = function() Util.terminal.open(nil, { cwd = Util.root.get(), float = { border = "rounded"} }) end
map("n", "<leader>ft", lazyterm, { desc = "Terminal (root dir)" })
map("n", "<leader>fT", function() Util.float_term() end, { desc = "Terminal (cwd)" })
map("n", "<c-`>", lazyterm, { desc = "Terminal (root dir)" })
map("n", "<C-`>", function() Util.terminal.open("zsh", { cwd = Util.root.get(), esc_esc = false, ctrl_hjkl = false, float = { border = "rounded"}}) end, { desc = "Zsh (root dir)" })

-- Terminal Mappings
map("t", "<esc><esc>", "<c-\\><c-n>", { desc = "Enter Normal Mode" })
Expand Down
2 changes: 2 additions & 0 deletions lua/config/options.lua
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ opt.updatetime = 200 -- Save swap file and trigger CursorHold
opt.wildmode = "longest:full,full" -- Command-line completion mode
opt.winminwidth = 5 -- Minimum window width
opt.wrap = true -- Disable line wrap
opt.thesaurus = "mythes-en"
opt.dictionary = "stardict"

if vim.fn.has("nvim-0.9.0") == 1 then
opt.splitkeep = "screen"
Expand Down
9 changes: 9 additions & 0 deletions lua/plugins/editor.lua
Original file line number Diff line number Diff line change
Expand Up @@ -121,4 +121,13 @@ return {
})
end,
},
{
"ixru/nvim-markdown",
},
{
"iamcco/markdown-preview.nvim",
config = function()
vim.fn["mkdp#util#install"]()
end,
},
}

0 comments on commit 5d9563f

Please sign in to comment.