mirror of
https://github.com/jdhao/nvim-config.git
synced 2025-06-08 14:14:33 +02:00
Compare commits
5 Commits
6b59c268f9
...
369687b047
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
369687b047 | ||
|
|
54908dfe9f | ||
|
|
2e5f5c5991 | ||
|
|
8291b15599 | ||
|
|
3de31f7d0a |
@ -88,16 +88,16 @@ and how to set up on different platforms (Linux, macOS, and Windows).
|
||||
|
||||
For more UI demos, check [here](https://github.com/jdhao/nvim-config/issues/15).
|
||||
|
||||
## Start screen with alpha-nvim
|
||||
## Start screen with dashboard-nvim
|
||||
|
||||
<p align="center">
|
||||
<img src="https://user-images.githubusercontent.com/16662357/139459989-0537ded4-c119-4749-99bf-b551ca1ba118.jpg" width="800">
|
||||
<img src="https://user-images.githubusercontent.com/16662357/183256752-fb23b215-a6b8-4646-beed-9999f52d53f1.png" width="800">
|
||||
</p>
|
||||
|
||||
## fuzzy finding using LeaderF
|
||||
## File fuzzy finding using LeaderF
|
||||
|
||||
<p align="center">
|
||||
<img src="https://user-images.githubusercontent.com/16662357/139462025-7bce98c5-d2d5-413f-9659-20545865cdca.gif" width="800">
|
||||
<img src="https://user-images.githubusercontent.com/16662357/183257017-2d9d7605-3c4b-4e1d-8955-30998f9b6f28.gif" width="800">
|
||||
</p>
|
||||
|
||||
## Code autocompletion with nvim-cmp
|
||||
|
||||
@ -37,7 +37,9 @@ let g:mapleader = ','
|
||||
let g:vimsyn_embed = 'l'
|
||||
|
||||
" Use English as main language
|
||||
if !g:is_mac
|
||||
language en_US.utf-8
|
||||
endif
|
||||
|
||||
" use filetype.lua instead of filetype.vim
|
||||
let g:do_filetype_lua = 1
|
||||
|
||||
@ -1,32 +0,0 @@
|
||||
local alpha = require("alpha")
|
||||
local dashboard = require("alpha.themes.dashboard")
|
||||
|
||||
-- Set header
|
||||
dashboard.section.header.val = {
|
||||
" ",
|
||||
" ███╗ ██╗███████╗ ██████╗ ██╗ ██╗██╗███╗ ███╗ ",
|
||||
" ████╗ ██║██╔════╝██╔═══██╗██║ ██║██║████╗ ████║ ",
|
||||
" ██╔██╗ ██║█████╗ ██║ ██║██║ ██║██║██╔████╔██║ ",
|
||||
" ██║╚██╗██║██╔══╝ ██║ ██║╚██╗ ██╔╝██║██║╚██╔╝██║ ",
|
||||
" ██║ ╚████║███████╗╚██████╔╝ ╚████╔╝ ██║██║ ╚═╝ ██║ ",
|
||||
" ╚═╝ ╚═══╝╚══════╝ ╚═════╝ ╚═══╝ ╚═╝╚═╝ ╚═╝ ",
|
||||
" ",
|
||||
}
|
||||
|
||||
-- Set menu
|
||||
dashboard.section.buttons.val = {
|
||||
dashboard.button( "Leader f f", " > Find file", ":Leaderf file --popup<CR>"),
|
||||
dashboard.button( "Leader f r", " > Recent files" , ":Leaderf mru --popup<CR>"),
|
||||
dashboard.button( "Leader f g", " > Project grep" , ":Leaderf rg --popup<CR>"),
|
||||
dashboard.button( "u", " > Update plugins" , ":PackerSync<CR>"),
|
||||
dashboard.button( "e", " > New file" , ":enew <CR>"),
|
||||
dashboard.button( "q", " > Quit NVIM", ":qa<CR>"),
|
||||
}
|
||||
|
||||
local fortune = require("alpha.fortune")
|
||||
dashboard.section.footer.val = fortune()
|
||||
|
||||
alpha.setup(dashboard.opts)
|
||||
|
||||
-- Send config to alpha
|
||||
alpha.setup(dashboard.opts)
|
||||
65
lua/config/dashboard-nvim.lua
Normal file
65
lua/config/dashboard-nvim.lua
Normal file
@ -0,0 +1,65 @@
|
||||
local dashboard = require("dashboard")
|
||||
|
||||
dashboard.custom_header = {
|
||||
" ",
|
||||
" ",
|
||||
" ",
|
||||
" ███╗ ██╗ ███████╗ ██████╗ ██╗ ██╗ ██╗ ███╗ ███╗",
|
||||
" ████╗ ██║ ██╔════╝██╔═══██╗ ██║ ██║ ██║ ████╗ ████║",
|
||||
" ██╔██╗ ██║ █████╗ ██║ ██║ ██║ ██║ ██║ ██╔████╔██║",
|
||||
" ██║╚██╗██║ ██╔══╝ ██║ ██║ ╚██╗ ██╔╝ ██║ ██║╚██╔╝██║",
|
||||
" ██║ ╚████║ ███████╗╚██████╔╝ ╚████╔╝ ██║ ██║ ╚═╝ ██║",
|
||||
" ╚═╝ ╚═══╝ ╚══════╝ ╚═════╝ ╚═══╝ ╚═╝ ╚═╝ ╚═╝",
|
||||
" ",
|
||||
" ",
|
||||
" ",
|
||||
" ",
|
||||
}
|
||||
|
||||
dashboard.custom_center = {
|
||||
{
|
||||
icon = " ",
|
||||
desc = "Find File ",
|
||||
action = "Leaderf file --popup",
|
||||
shortcut = "<Leader> f f",
|
||||
},
|
||||
{
|
||||
icon = " ",
|
||||
desc = "Recently opened files ",
|
||||
action = "Leaderf mru --popup",
|
||||
shortcut = "<Leader> f r",
|
||||
},
|
||||
{
|
||||
icon = " ",
|
||||
desc = "Project grep ",
|
||||
action = "Leaderf rg --popup",
|
||||
shortcut = "<Leader> f g",
|
||||
},
|
||||
{
|
||||
icon = " ",
|
||||
desc = "Open Nvim config ",
|
||||
action = "tabnew $MYVIMRC | tcd %:p:h",
|
||||
shortcut = "<Leader> e v",
|
||||
},
|
||||
{
|
||||
icon = " ",
|
||||
desc = "New file ",
|
||||
action = "enew",
|
||||
shortcut = "e ",
|
||||
},
|
||||
{
|
||||
icon = " ",
|
||||
desc = "Quit Nvim ",
|
||||
-- desc = "Quit Nvim ",
|
||||
action = "qa",
|
||||
shortcut = "q "
|
||||
}
|
||||
}
|
||||
|
||||
vim.cmd([[
|
||||
augroup dashboard_enter
|
||||
au!
|
||||
autocmd FileType dashboard nnoremap <buffer> q :qa<CR>
|
||||
autocmd FileType dashboard nnoremap <buffer> e :enew<CR>
|
||||
augroup END
|
||||
]])
|
||||
@ -21,6 +21,10 @@ local function ime_state()
|
||||
end
|
||||
|
||||
local function trailing_space()
|
||||
if not vim.o.modifiable then
|
||||
return ""
|
||||
end
|
||||
|
||||
local line_num = nil
|
||||
|
||||
for i=1, fn.line('$') do
|
||||
@ -43,6 +47,10 @@ local function trailing_space()
|
||||
end
|
||||
|
||||
local function mixed_indent()
|
||||
if not vim.o.modifiable then
|
||||
return ""
|
||||
end
|
||||
|
||||
local space_pat = [[\v^ +]]
|
||||
local tab_pat = [[\v^\t+]]
|
||||
local space_indent = fn.search(space_pat, 'nwc')
|
||||
|
||||
@ -139,7 +139,7 @@ packer.startup({
|
||||
use({ "akinsho/bufferline.nvim", event = "VimEnter", config = [[require('config.bufferline')]] })
|
||||
|
||||
-- fancy start screen
|
||||
-- use { 'goolord/alpha-nvim', event = 'VimEnter', config = [[require('config.alpha-nvim')]] }
|
||||
use { 'glepnir/dashboard-nvim', config = [[require('config.dashboard-nvim')]] }
|
||||
|
||||
use({
|
||||
"lukas-reineke/indent-blankline.nvim",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user