1
0
Fork 0

Update deps & replace bufferline with heirline

This commit is contained in:
Daniel Kempkens 2022-08-28 22:57:36 +02:00
parent 5b6e7c50da
commit 0b6ed8e8e5
Signed by: daniel
SSH key fingerprint: SHA256:Ks/MyhQYcPRQiwMKLAKquWCdCPe3JXlb1WttgnAoSeM
8 changed files with 96 additions and 53 deletions

View file

@ -31,10 +31,6 @@
(keymap.set :n :<leader>r repl.toggle-repl {:desc "Toggle REPL"}) (keymap.set :n :<leader>r repl.toggle-repl {:desc "Toggle REPL"})
(keymap.set :n :<leader>bl #(telescope-builtin.buffers telescope-dropdown) (keymap.set :n :<leader>bl #(telescope-builtin.buffers telescope-dropdown)
{:desc "List Buffers"}) {:desc "List Buffers"})
(keymap.set :n :<leader>bn :<cmd>BufferLineCycleNext<CR>
{:desc "Next Buffer"})
(keymap.set :n :<leader>bp :<cmd>BufferLineCyclePrev<CR>
{:desc "Previous Buffer"})
(keymap.set :n :<leader>bf (keymap.set :n :<leader>bf
#(telescope-builtin.current_buffer_fuzzy_find telescope-dropdown) #(telescope-builtin.current_buffer_fuzzy_find telescope-dropdown)
{:desc "Find In Buffer"}) {:desc "Find In Buffer"})

View file

@ -164,7 +164,7 @@
(set self.git-changed (or git-status.changed 0)))) (set self.git-changed (or git-status.changed 0))))
1 {:provider #(.. "  " $1.git-head " ") 1 {:provider #(.. "  " $1.git-head " ")
:hl {:fg colors.black :bg colors.orange :bold true}} :hl {:fg colors.black :bg colors.orange :bold true}}
2 {:provider " "} 2 mod.space
3 {:provider (fn [self] 3 {:provider (fn [self]
(.. " " self.git-added " ")) (.. " " self.git-added " "))
:hl {:fg colors.bright_green}} :hl {:fg colors.bright_green}}
@ -227,7 +227,7 @@
(set mod.buffer-options (set mod.buffer-options
{:static {:format {:dos "" :unix "" :mac ""}} {:static {:format {:dos "" :unix "" :mac ""}}
:hl {:fg colors.black :bg colors.orange} :hl {:fg colors.black :bg colors.orange}
1 {:provider " "} 1 mod.space
2 {:condition #(buffer-variable-exists? :nifoc_lsp_enabled) 2 {:condition #(buffer-variable-exists? :nifoc_lsp_enabled)
:provider " " :provider " "
:on_click {:name :heirline_buffer_options_lsp :on_click {:name :heirline_buffer_options_lsp

View file

@ -0,0 +1,71 @@
(let [mod {}
api vim.api
heirline-utils (require :heirline.utils)
dracula (require :dracula)
colors (dracula.colors)
statusline (require :nifoc.statusline)]
;; Utils
(set mod.truncate-left {:provider "" :hl {:fg :gray}})
(set mod.truncate-right {:provider "" :hl {:fg :gray}})
;; Filename
(set mod.filename-block
{:init (fn [self]
(set self.filename (api.nvim_buf_get_name self.bufnr)))
:hl (fn [self]
(if self.is_active :TabLineSel :TabLine))
:on_click {:name :heirline_tabline_buffer_callback
:callback (fn [_ minwid]
(api.nvim_win_set_buf 0 minwid))
:minwid (fn [self]
self.bufnr)}})
(set mod.filename
{:provider (fn [self]
(if (= self.filename "") "[No Name]"
(vim.fn.fnamemodify self.filename ":t")))
:hl (fn [self]
(let [visible (or self.is_active self.is_visible)]
{:bold visible :italic visible}))})
(set mod.file-flags [{:provider (fn [self]
(when (. vim :bo self.bufnr :modified)
" "))
:hl {:fg colors.yellow}}
{:provider (fn [self]
(when (or (not (. vim :bo self.bufnr
:modifiable))
(. vim :bo self.bufnr :readonly))
" "))
:hl {:fg colors.orange}}])
(set mod.filename-block
(heirline-utils.insert mod.filename-block statusline.file-icon
mod.filename mod.file-flags))
;; Buttons
(set mod.close-button
{:condition (fn [self]
(not (. vim :bo self.bufnr :modified)))
1 statusline.space
2 {:provider ""
:hl {:fg :gray}
:on_click {:name :heirline_tabline_close_buffer_callback
:callback (fn [_ minwid]
(api.nvim_buf_delete minwid {:force false}))
:minwid (fn [self]
self.bufnr)}}})
;; Indicator
(set mod.active-indicator
{:provider (fn [self]
(if self.is_active "┃ " " "))
:hl {:fg colors.purple :bold true}})
;; Block
(set mod.buffer-block
(heirline-utils.surround [" " " "]
(fn [self]
(if self.is_active
(. (heirline-utils.get_highlight :TabLineSel)
:bg)
(. (heirline-utils.get_highlight :TabLine)
:bg)))
[mod.active-indicator
mod.filename-block
mod.close-button]))
mod)

View file

@ -1,10 +0,0 @@
(let [bufferline (require :bufferline)]
(bufferline.setup {:options {:show_close_icon false
:diagnostics :nvim_lsp
:diagnostics_indicator (lambda [count
?level
?diagnostics-dict
context]
(if (context.buffer:current)
""
(.. " (" count ")")))}}))

View file

@ -1,7 +1,8 @@
(let [heirline (require :heirline) (let [heirline (require :heirline)
utils (require :heirline.utils) utils (require :heirline.utils)
conditions (require :heirline.conditions) conditions (require :heirline.conditions)
ns (require :nifoc.statusline)] ns (require :nifoc.statusline)
nt (require :nifoc.tabline)]
(local default-statusline [;; Left (local default-statusline [;; Left
ns.vi-mode ns.vi-mode
(ns.insert-left-unless-empty ns.git " ") (ns.insert-left-unless-empty ns.git " ")
@ -35,7 +36,10 @@
1 telescope-statusline 1 telescope-statusline
2 shell-statusline 2 shell-statusline
3 default-statusline}) 3 default-statusline})
;; Load Statusline (local winbar nil)
(local tabline (utils.make_buflist nt.buffer-block nt.truncate-left
nt.truncate-right))
;; Load Lines
(set vim.opt.laststatus 3) (set vim.opt.laststatus 3)
(heirline.setup statuslines)) (heirline.setup statuslines winbar tabline))

View file

@ -265,12 +265,6 @@ in
type = "fennel"; type = "fennel";
} }
{
plugin = bufferline-nvim;
config = builtins.readFile ../../config/nvim/plugins/bufferline.fnl;
type = "fennel";
}
{ {
plugin = indent-blankline-nvim; plugin = indent-blankline-nvim;
config = builtins.readFile ../../config/nvim/plugins/indent_line.fnl; config = builtins.readFile ../../config/nvim/plugins/indent_line.fnl;

View file

@ -91,12 +91,12 @@ rec {
}; };
leap-nvim = pkgs.vimUtils.buildVimPluginFrom2Nix { leap-nvim = pkgs.vimUtils.buildVimPluginFrom2Nix {
pname = "leap.nvim"; pname = "leap.nvim";
version = "2022-08-19"; version = "2022-08-28";
src = pkgs.fetchFromGitHub { src = pkgs.fetchFromGitHub {
owner = "ggandor"; owner = "ggandor";
repo = "leap.nvim"; repo = "leap.nvim";
rev = "91897282189608125025e804912cebbc7c947ce5"; rev = "5cd1edbe9ecd05c9765b656d4a8016065135873f";
sha256 = "1slm45scygcm1yb1sjzv0whxh4jzkd584m95wl2qxww1c05gqb3r"; sha256 = "0gz04g336irbwaahia0qkdj8gkfgy589kqrax9ni4bch86v8473b";
fetchSubmodules = false; fetchSubmodules = false;
}; };
}; };
@ -234,8 +234,8 @@ rec {
src = pkgs.fetchFromGitHub { src = pkgs.fetchFromGitHub {
owner = "neovim"; owner = "neovim";
repo = "nvim-lspconfig"; repo = "nvim-lspconfig";
rev = "7f0dc42f02fd24fbbea2afa66508ba1e50b29483"; rev = "cedfda66a6cdfc32b370b2d4bd5b5c3c9cb4ab38";
sha256 = "0w09a8wnh6z1klrxmml1h970n814qn6ln6vrsxbgfqwcsahrsrwc"; sha256 = "19znglik19nzz0r3vf83ngrv3yqj3c5f966qabwp0wlvjfqrk520";
fetchSubmodules = false; fetchSubmodules = false;
}; };
}; };
@ -285,12 +285,12 @@ rec {
}; };
LuaSnip = pkgs.vimUtils.buildVimPluginFrom2Nix { LuaSnip = pkgs.vimUtils.buildVimPluginFrom2Nix {
pname = "LuaSnip"; pname = "LuaSnip";
version = "2022-08-27"; version = "2022-08-28";
src = pkgs.fetchFromGitHub { src = pkgs.fetchFromGitHub {
owner = "L3MON4D3"; owner = "L3MON4D3";
repo = "LuaSnip"; repo = "LuaSnip";
rev = "b9450d848163c438a1cc31be5805546ae9694781"; rev = "9f454cc75b3f8ca129ec3b59abcb75e40bfd7246";
sha256 = "1lja00a274xncjxyciny1gi7grnwnn3cz6xvjxc8243bjc0dfqmw"; sha256 = "1kcv5abxh7jl2zp4p1bdvvsrxcfwb103lsfnrkxf68xm3mka09ws";
fetchSubmodules = false; fetchSubmodules = false;
}; };
}; };
@ -472,12 +472,12 @@ rec {
}; };
nvim-surround = pkgs.vimUtils.buildVimPluginFrom2Nix { nvim-surround = pkgs.vimUtils.buildVimPluginFrom2Nix {
pname = "nvim-surround"; pname = "nvim-surround";
version = "2022-08-24"; version = "2022-08-28";
src = pkgs.fetchFromGitHub { src = pkgs.fetchFromGitHub {
owner = "kylechui"; owner = "kylechui";
repo = "nvim-surround"; repo = "nvim-surround";
rev = "48540cf24c1744c8f089099270fa8acea2672125"; rev = "892ab091f4e41af4e087bd1e2a90c4020763b28b";
sha256 = "1wrnf8qcncf3gxgzqdic19i3hylcyl9774pflsmk0al4irzi7jxf"; sha256 = "1g0p2r9nvlypfvxg4nfddpnk9rk667dxi04i2i3x78p0fbfn50ri";
fetchSubmodules = false; fetchSubmodules = false;
}; };
}; };
@ -487,19 +487,8 @@ rec {
src = pkgs.fetchFromGitHub { src = pkgs.fetchFromGitHub {
owner = "rebelot"; owner = "rebelot";
repo = "heirline.nvim"; repo = "heirline.nvim";
rev = "432a4bd8fd1d73b955e1dfdfe89dfc9db01dabc1"; rev = "489aa37a6aec30c43217bd4ddc75ef9f945c9d0d";
sha256 = "1ijrlymswrzkggqz0dsxli8png78k64k76aj1ni7dgsp4dnlswns"; sha256 = "0ig9h71wl6ac7injl7mzdxzbx6aa7jc8g37xfbi1l2bndfnc9brw";
fetchSubmodules = false;
};
};
bufferline-nvim = pkgs.vimUtils.buildVimPluginFrom2Nix {
pname = "bufferline.nvim";
version = "2022-08-25";
src = pkgs.fetchFromGitHub {
owner = "akinsho";
repo = "bufferline.nvim";
rev = "fb7b17362eb6eedc57c37bdfd364f8e7d8149e31";
sha256 = "1q0g99099qvl9s9k4vrrb99hg8qpps7k1pzgba5m6ibiqmzny70f";
fetchSubmodules = false; fetchSubmodules = false;
}; };
}; };
@ -527,12 +516,12 @@ rec {
}; };
toggleterm-nvim = pkgs.vimUtils.buildVimPluginFrom2Nix { toggleterm-nvim = pkgs.vimUtils.buildVimPluginFrom2Nix {
pname = "toggleterm.nvim"; pname = "toggleterm.nvim";
version = "2022-08-25"; version = "2022-08-28";
src = pkgs.fetchFromGitHub { src = pkgs.fetchFromGitHub {
owner = "akinsho"; owner = "akinsho";
repo = "toggleterm.nvim"; repo = "toggleterm.nvim";
rev = "7fb7cdf875f6c07285e4aae6a1a7f27b77b3485c"; rev = "f494c61024ffa25ee407d55b04d8b28ba9e839cb";
sha256 = "0i7jzwa7rz5ih6394y9wqr79mivc97hhy40fq4j8gq40b9nx3yj6"; sha256 = "15p82699ac7svhjgf93fkyyl18nymfhjyhkxiv7vk373mvkhxh4x";
fetchSubmodules = false; fetchSubmodules = false;
}; };
}; };

View file

@ -79,7 +79,6 @@
# UI # UI
- src: rebelot/heirline.nvim - src: rebelot/heirline.nvim
- src: akinsho/bufferline.nvim
- src: lukas-reineke/indent-blankline.nvim - src: lukas-reineke/indent-blankline.nvim
- src: lukas-reineke/virt-column.nvim - src: lukas-reineke/virt-column.nvim
- src: akinsho/toggleterm.nvim - src: akinsho/toggleterm.nvim