1
0
mirror of https://github.com/jdhao/nvim-config.git synced 2025-06-08 14:14:33 +02:00

Compare commits

..

No commits in common. "369687b047d851e46577ef8d1f9198ca8c97697f" and "6b59c268f9a75cfbd3e9c87853c6686d2f07fc2c" have entirely different histories.

6 changed files with 38 additions and 81 deletions

View File

@ -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). For more UI demos, check [here](https://github.com/jdhao/nvim-config/issues/15).
## Start screen with dashboard-nvim ## Start screen with alpha-nvim
<p align="center"> <p align="center">
<img src="https://user-images.githubusercontent.com/16662357/183256752-fb23b215-a6b8-4646-beed-9999f52d53f1.png" width="800"> <img src="https://user-images.githubusercontent.com/16662357/139459989-0537ded4-c119-4749-99bf-b551ca1ba118.jpg" width="800">
</p> </p>
## File fuzzy finding using LeaderF ## fuzzy finding using LeaderF
<p align="center"> <p align="center">
<img src="https://user-images.githubusercontent.com/16662357/183257017-2d9d7605-3c4b-4e1d-8955-30998f9b6f28.gif" width="800"> <img src="https://user-images.githubusercontent.com/16662357/139462025-7bce98c5-d2d5-413f-9659-20545865cdca.gif" width="800">
</p> </p>
## Code autocompletion with nvim-cmp ## Code autocompletion with nvim-cmp

View File

@ -37,9 +37,7 @@ let g:mapleader = ','
let g:vimsyn_embed = 'l' let g:vimsyn_embed = 'l'
" Use English as main language " Use English as main language
if !g:is_mac language en_US.utf-8
language en_US.utf-8
endif
" use filetype.lua instead of filetype.vim " use filetype.lua instead of filetype.vim
let g:do_filetype_lua = 1 let g:do_filetype_lua = 1

32
lua/config/alpha-nvim.lua Normal file
View File

@ -0,0 +1,32 @@
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)

View File

@ -1,65 +0,0 @@
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
]])

View File

@ -21,10 +21,6 @@ local function ime_state()
end end
local function trailing_space() local function trailing_space()
if not vim.o.modifiable then
return ""
end
local line_num = nil local line_num = nil
for i=1, fn.line('$') do for i=1, fn.line('$') do
@ -47,10 +43,6 @@ local function trailing_space()
end end
local function mixed_indent() local function mixed_indent()
if not vim.o.modifiable then
return ""
end
local space_pat = [[\v^ +]] local space_pat = [[\v^ +]]
local tab_pat = [[\v^\t+]] local tab_pat = [[\v^\t+]]
local space_indent = fn.search(space_pat, 'nwc') local space_indent = fn.search(space_pat, 'nwc')

View File

@ -139,7 +139,7 @@ packer.startup({
use({ "akinsho/bufferline.nvim", event = "VimEnter", config = [[require('config.bufferline')]] }) use({ "akinsho/bufferline.nvim", event = "VimEnter", config = [[require('config.bufferline')]] })
-- fancy start screen -- fancy start screen
use { 'glepnir/dashboard-nvim', config = [[require('config.dashboard-nvim')]] } -- use { 'goolord/alpha-nvim', event = 'VimEnter', config = [[require('config.alpha-nvim')]] }
use({ use({
"lukas-reineke/indent-blankline.nvim", "lukas-reineke/indent-blankline.nvim",