mirror of
https://github.com/jdhao/nvim-config.git
synced 2025-06-08 14:14:33 +02:00
Compare commits
6 Commits
v0.9.0
...
plug/leap-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7bb3ccc275 | ||
|
|
ee38046ebc | ||
|
|
6c873a32da | ||
|
|
9ca65fd942 | ||
|
|
cc3a7d6ebd | ||
|
|
f3a359a2fa |
@@ -13,7 +13,7 @@
|
|||||||
<img alt="Latest release" src="https://img.shields.io/github/v/release/jdhao/nvim-config" />
|
<img alt="Latest release" src="https://img.shields.io/github/v/release/jdhao/nvim-config" />
|
||||||
</a>
|
</a>
|
||||||
<a href="https://github.com/neovim/neovim/releases/tag/stable">
|
<a href="https://github.com/neovim/neovim/releases/tag/stable">
|
||||||
<img src="https://img.shields.io/badge/Neovim-0.8.1-blueviolet.svg?style=flat-square&logo=Neovim&logoColor=green" alt="Neovim minimum version"/>
|
<img src="https://img.shields.io/badge/Neovim-0.9.1-blueviolet.svg?style=flat-square&logo=Neovim&logoColor=green" alt="Neovim minimum version"/>
|
||||||
</a>
|
</a>
|
||||||
<a href="https://github.com/jdhao/nvim-config/search?l=vim-script">
|
<a href="https://github.com/jdhao/nvim-config/search?l=vim-script">
|
||||||
<img src="https://img.shields.io/github/languages/top/jdhao/nvim-config" alt="Top languages"/>
|
<img src="https://img.shields.io/github/languages/top/jdhao/nvim-config" alt="Top languages"/>
|
||||||
@@ -21,8 +21,8 @@
|
|||||||
<a href="https://github.com/jdhao/nvim-config/graphs/commit-activity">
|
<a href="https://github.com/jdhao/nvim-config/graphs/commit-activity">
|
||||||
<img src="https://img.shields.io/github/commit-activity/m/jdhao/nvim-config?style=flat-square" />
|
<img src="https://img.shields.io/github/commit-activity/m/jdhao/nvim-config?style=flat-square" />
|
||||||
</a>
|
</a>
|
||||||
<a href="https://github.com/jdhao/nvim-config/releases/tag/v0.8.1">
|
<a href="https://github.com/jdhao/nvim-config/releases/tag/v0.9.1">
|
||||||
<img src="https://img.shields.io/github/commits-since/jdhao/nvim-config/v0.8.1?style=flat-square" />
|
<img src="https://img.shields.io/github/commits-since/jdhao/nvim-config/v0.9.1?style=flat-square" />
|
||||||
</a>
|
</a>
|
||||||
<a href="https://github.com/jdhao/nvim-config/graphs/contributors">
|
<a href="https://github.com/jdhao/nvim-config/graphs/contributors">
|
||||||
<img src="https://img.shields.io/github/contributors/jdhao/nvim-config?style=flat-square" />
|
<img src="https://img.shields.io/github/contributors/jdhao/nvim-config?style=flat-square" />
|
||||||
|
|||||||
6
after/ftplugin/json.vim
Normal file
6
after/ftplugin/json.vim
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
" let the initial folding state be that all folds are closed.
|
||||||
|
set foldlevel=0
|
||||||
|
|
||||||
|
" Use nvim-treesitter for folding
|
||||||
|
set foldmethod=expr
|
||||||
|
set foldexpr=nvim_treesitter#foldexpr()
|
||||||
3
init.lua
3
init.lua
@@ -9,12 +9,13 @@
|
|||||||
-- Blog: https://jdhao.github.io/
|
-- Blog: https://jdhao.github.io/
|
||||||
-- GitHub: https://github.com/jdhao
|
-- GitHub: https://github.com/jdhao
|
||||||
-- StackOverflow: https://stackoverflow.com/users/6064933/jdhao
|
-- StackOverflow: https://stackoverflow.com/users/6064933/jdhao
|
||||||
|
vim.loader.enable()
|
||||||
|
|
||||||
local api = vim.api
|
local api = vim.api
|
||||||
local version = vim.version
|
local version = vim.version
|
||||||
|
|
||||||
-- check if we have the latest stable version of nvim
|
-- check if we have the latest stable version of nvim
|
||||||
local expected_ver = "0.9.0"
|
local expected_ver = "0.9.1"
|
||||||
local ev = version.parse(expected_ver)
|
local ev = version.parse(expected_ver)
|
||||||
local actual_ver = version()
|
local actual_ver = version()
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,8 @@ local api = vim.api
|
|||||||
local keymap = vim.keymap
|
local keymap = vim.keymap
|
||||||
local dashboard = require("dashboard")
|
local dashboard = require("dashboard")
|
||||||
|
|
||||||
dashboard.custom_header = {
|
conf = {}
|
||||||
|
conf.header = {
|
||||||
" ",
|
" ",
|
||||||
" ",
|
" ",
|
||||||
" ",
|
" ",
|
||||||
@@ -18,46 +19,52 @@ dashboard.custom_header = {
|
|||||||
" ",
|
" ",
|
||||||
}
|
}
|
||||||
|
|
||||||
dashboard.custom_center = {
|
conf.center = {
|
||||||
{
|
{
|
||||||
icon = " ",
|
icon = " ",
|
||||||
desc = "Find File ",
|
desc = "Find File ",
|
||||||
action = "Leaderf file --popup",
|
action = "Leaderf file --popup",
|
||||||
shortcut = "<Leader> f f",
|
key = "<Leader> f f",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
icon = " ",
|
icon = " ",
|
||||||
desc = "Recently opened files ",
|
desc = "Recently opened files ",
|
||||||
action = "Leaderf mru --popup",
|
action = "Leaderf mru --popup",
|
||||||
shortcut = "<Leader> f r",
|
key = "<Leader> f r",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
icon = " ",
|
icon = " ",
|
||||||
desc = "Project grep ",
|
desc = "Project grep ",
|
||||||
action = "Leaderf rg --popup",
|
action = "Leaderf rg --popup",
|
||||||
shortcut = "<Leader> f g",
|
key = "<Leader> f g",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
icon = " ",
|
icon = " ",
|
||||||
desc = "Open Nvim config ",
|
desc = "Open Nvim config ",
|
||||||
action = "tabnew $MYVIMRC | tcd %:p:h",
|
action = "tabnew $MYVIMRC | tcd %:p:h",
|
||||||
shortcut = "<Leader> e v",
|
key = "<Leader> e v",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
icon = " ",
|
icon = " ",
|
||||||
desc = "New file ",
|
desc = "New file ",
|
||||||
action = "enew",
|
action = "enew",
|
||||||
shortcut = "e ",
|
key = "e",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
icon = " ",
|
icon = " ",
|
||||||
desc = "Quit Nvim ",
|
desc = "Quit Nvim ",
|
||||||
-- desc = "Quit Nvim ",
|
-- desc = "Quit Nvim ",
|
||||||
action = "qa",
|
action = "qa",
|
||||||
shortcut = "q ",
|
key = "q",
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
dashboard.setup({
|
||||||
|
theme = 'doom',
|
||||||
|
shortcut_type = 'number',
|
||||||
|
config = conf
|
||||||
|
})
|
||||||
|
|
||||||
api.nvim_create_autocmd("FileType", {
|
api.nvim_create_autocmd("FileType", {
|
||||||
pattern = "dashboard",
|
pattern = "dashboard",
|
||||||
group = api.nvim_create_augroup("dashboard_enter", { clear = true }),
|
group = api.nvim_create_augroup("dashboard_enter", { clear = true }),
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
require("nvim-treesitter.configs").setup {
|
require("nvim-treesitter.configs").setup {
|
||||||
ensure_installed = { "python", "cpp", "lua", "vim" },
|
ensure_installed = { "python", "cpp", "lua", "vim", "json" },
|
||||||
ignore_install = {}, -- List of parsers to ignore installing
|
ignore_install = {}, -- List of parsers to ignore installing
|
||||||
highlight = {
|
highlight = {
|
||||||
enable = true, -- false will disable the whole extension
|
enable = true, -- false will disable the whole extension
|
||||||
|
|||||||
@@ -43,9 +43,6 @@ end
|
|||||||
|
|
||||||
packer.startup {
|
packer.startup {
|
||||||
function(use)
|
function(use)
|
||||||
-- it is recommended to put impatient.nvim before any other plugins
|
|
||||||
use { "lewis6991/impatient.nvim", config = [[require('impatient')]] }
|
|
||||||
|
|
||||||
use { "wbthomason/packer.nvim", opt = true }
|
use { "wbthomason/packer.nvim", opt = true }
|
||||||
|
|
||||||
use { "onsails/lspkind-nvim", event = "VimEnter" }
|
use { "onsails/lspkind-nvim", event = "VimEnter" }
|
||||||
@@ -151,7 +148,7 @@ packer.startup {
|
|||||||
config = [[require('config.bufferline')]] }
|
config = [[require('config.bufferline')]] }
|
||||||
|
|
||||||
-- fancy start screen
|
-- fancy start screen
|
||||||
use { "glepnir/dashboard-nvim", event = "VimEnter",
|
use { "nvimdev/dashboard-nvim", event = "VimEnter",
|
||||||
cond = firenvim_not_active,
|
cond = firenvim_not_active,
|
||||||
config = [[require('config.dashboard-nvim')]]
|
config = [[require('config.dashboard-nvim')]]
|
||||||
}
|
}
|
||||||
@@ -365,7 +362,7 @@ packer.startup {
|
|||||||
|
|
||||||
use { "ii14/emmylua-nvim", ft = "lua" }
|
use { "ii14/emmylua-nvim", ft = "lua" }
|
||||||
|
|
||||||
use { "j-hui/fidget.nvim", after = "nvim-lspconfig", config = [[require('config.fidget-nvim')]] }
|
use { "j-hui/fidget.nvim", after = "nvim-lspconfig", tag = "legacy", config = [[require('config.fidget-nvim')]] }
|
||||||
end,
|
end,
|
||||||
config = {
|
config = {
|
||||||
max_jobs = 16,
|
max_jobs = 16,
|
||||||
|
|||||||
@@ -45,3 +45,6 @@ function! s:md_to_pdf() abort
|
|||||||
echoerr "Error running command"
|
echoerr "Error running command"
|
||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
" json format
|
||||||
|
command! -range JSONFormat <line1>,<line2>!python -m json.tool
|
||||||
|
|||||||
Reference in New Issue
Block a user