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>bl #(telescope-builtin.buffers telescope-dropdown)
{: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
#(telescope-builtin.current_buffer_fuzzy_find telescope-dropdown)
{:desc "Find In Buffer"})

View file

@ -164,7 +164,7 @@
(set self.git-changed (or git-status.changed 0))))
1 {:provider #(.. "  " $1.git-head " ")
:hl {:fg colors.black :bg colors.orange :bold true}}
2 {:provider " "}
2 mod.space
3 {:provider (fn [self]
(.. " " self.git-added " "))
:hl {:fg colors.bright_green}}
@ -227,7 +227,7 @@
(set mod.buffer-options
{:static {:format {:dos "" :unix "" :mac ""}}
:hl {:fg colors.black :bg colors.orange}
1 {:provider " "}
1 mod.space
2 {:condition #(buffer-variable-exists? :nifoc_lsp_enabled)
:provider " "
: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)
utils (require :heirline.utils)
conditions (require :heirline.conditions)
ns (require :nifoc.statusline)]
ns (require :nifoc.statusline)
nt (require :nifoc.tabline)]
(local default-statusline [;; Left
ns.vi-mode
(ns.insert-left-unless-empty ns.git " ")
@ -35,7 +36,10 @@
1 telescope-statusline
2 shell-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)
(heirline.setup statuslines))
(heirline.setup statuslines winbar tabline))

View file

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

View file

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

View file

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