mirror of
https://github.com/jdhao/nvim-config.git
synced 2025-06-08 14:14:33 +02:00
Compare commits
10 Commits
644993a89e
...
plug/leap-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7bb3ccc275 | ||
|
|
ee38046ebc | ||
|
|
6c873a32da | ||
|
|
9ca65fd942 | ||
|
|
cc3a7d6ebd | ||
|
|
f3a359a2fa | ||
|
|
9a4d71db88 | ||
|
|
dc597004df | ||
|
|
164d6129f8 | ||
|
|
cde21f6f67 |
@@ -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" />
|
||||||
@@ -69,7 +69,7 @@ and how to set up on different platforms (Linux, macOS, and Windows).
|
|||||||
+ Fast buffer jump via [hop.nvim](https://github.com/phaazon/hop.nvim).
|
+ Fast buffer jump via [hop.nvim](https://github.com/phaazon/hop.nvim).
|
||||||
+ Powerful snippet insertion via [Ultisnips](https://github.com/SirVer/ultisnips).
|
+ Powerful snippet insertion via [Ultisnips](https://github.com/SirVer/ultisnips).
|
||||||
+ Beautiful statusline via [lualine.nvim](https://github.com/nvim-lualine/lualine.nvim).
|
+ Beautiful statusline via [lualine.nvim](https://github.com/nvim-lualine/lualine.nvim).
|
||||||
+ File tree explorer via [nvim-tree.lua](https://github.com/kyazdani42/nvim-tree.lua).
|
+ File tree explorer via [nvim-tree.lua](https://github.com/nvim-tree/nvim-tree.lua).
|
||||||
+ Better quickfix list with [nvim-bqf](https://github.com/kevinhwang91/nvim-bqf).
|
+ Better quickfix list with [nvim-bqf](https://github.com/kevinhwang91/nvim-bqf).
|
||||||
+ Show search index and count with [nvim-hlslens](https://github.com/kevinhwang91/nvim-hlslens).
|
+ Show search index and count with [nvim-hlslens](https://github.com/kevinhwang91/nvim-hlslens).
|
||||||
+ Command line auto-completion via [wilder.nvim](https://github.com/gelguy/wilder.nvim).
|
+ Command line auto-completion via [wilder.nvim](https://github.com/gelguy/wilder.nvim).
|
||||||
|
|||||||
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 }),
|
||||||
|
|||||||
@@ -7,9 +7,6 @@ nvim_tree.setup {
|
|||||||
hijack_cursor = false,
|
hijack_cursor = false,
|
||||||
hijack_netrw = true,
|
hijack_netrw = true,
|
||||||
hijack_unnamed_buffer_when_opening = false,
|
hijack_unnamed_buffer_when_opening = false,
|
||||||
ignore_buffer_on_setup = false,
|
|
||||||
open_on_setup = false,
|
|
||||||
open_on_setup_file = false,
|
|
||||||
open_on_tab = false,
|
open_on_tab = false,
|
||||||
sort_by = "name",
|
sort_by = "name",
|
||||||
update_cwd = false,
|
update_cwd = false,
|
||||||
@@ -50,7 +47,6 @@ nvim_tree.setup {
|
|||||||
update_cwd = false,
|
update_cwd = false,
|
||||||
ignore_list = {},
|
ignore_list = {},
|
||||||
},
|
},
|
||||||
ignore_ft_on_setup = {},
|
|
||||||
system_open = {
|
system_open = {
|
||||||
cmd = "",
|
cmd = "",
|
||||||
args = {},
|
args = {},
|
||||||
@@ -113,6 +109,7 @@ nvim_tree.setup {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
keymap.set("n", "<space>s", function()
|
keymap.set("n", "<space>s", require("nvim-tree.api").tree.toggle, {
|
||||||
return require("nvim-tree").toggle(false, true)
|
silent = true,
|
||||||
end, { silent = true, desc = "toggle nvim-tree" })
|
desc = "toggle nvim-tree",
|
||||||
|
})
|
||||||
|
|||||||
@@ -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" }
|
||||||
@@ -137,7 +134,7 @@ packer.startup {
|
|||||||
use { "tanvirtin/monokai.nvim", opt = true }
|
use { "tanvirtin/monokai.nvim", opt = true }
|
||||||
use { "marko-cerovac/material.nvim", opt = true }
|
use { "marko-cerovac/material.nvim", opt = true }
|
||||||
|
|
||||||
use { "kyazdani42/nvim-web-devicons", event = "VimEnter" }
|
use { "nvim-tree/nvim-web-devicons", event = "VimEnter" }
|
||||||
|
|
||||||
use {
|
use {
|
||||||
"nvim-lualine/lualine.nvim",
|
"nvim-lualine/lualine.nvim",
|
||||||
@@ -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')]]
|
||||||
}
|
}
|
||||||
@@ -358,14 +355,14 @@ packer.startup {
|
|||||||
|
|
||||||
-- file explorer
|
-- file explorer
|
||||||
use {
|
use {
|
||||||
"kyazdani42/nvim-tree.lua",
|
"nvim-tree/nvim-tree.lua",
|
||||||
requires = { "kyazdani42/nvim-web-devicons" },
|
requires = { "nvim-tree/nvim-web-devicons" },
|
||||||
config = [[require('config.nvim-tree')]],
|
config = [[require('config.nvim-tree')]],
|
||||||
}
|
}
|
||||||
|
|
||||||
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