Skip to content

Commit

Permalink
fix: bufferline close commands
Browse files Browse the repository at this point in the history
  • Loading branch information
rafi committed May 17, 2024
1 parent cc66557 commit de94dfd
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 7 deletions.
17 changes: 15 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,36 @@ SHELL := /usr/bin/env bash
XDG_CACHE_HOME ?= $(HOME)/.cache
XDG_CONFIG_HOME ?= $(HOME)/.config
XDG_DATA_HOME ?= $(HOME)/.local/share
XDG_STATE_HOME ?= $(XDG_DATA_HOME)
XDG_STATE_HOME ?= $(HOME)/.local/state

default: install

.PHONY: install update
install: create-dirs update-plugins
update: update-repo update-plugins

.PHONY: create-dirs
create-dirs:
@mkdir -vp "$(XDG_CONFIG_HOME)"/nvim/spell
@mkdir -vp "$(XDG_DATA_HOME)"/nvim/site/spell
@mkdir -vp "$(XDG_STATE_HOME)"/nvim/{backup,sessions,shada,swap,undo}

.PHONY: update-repo
update-repo:
git pull --ff --ff-only

.PHONY: update-plugins
update-plugins:
nvim --headless '+Lazy! sync' +qa
@echo

.PHONY: uninstall
uninstall:
-rm -rf "$(XDG_DATA_HOME)"/nvim/{lazy,theme.txt,rplugin.vim}
-rm -rf "$(XDG_STATE_HOME)"/nvim/lazy
-rm -rf "$(XDG_CACHE_HOME)"/nvim/venv

.PHONY: venv
venv:
ifeq (, $(shell which pyenv-virtualenv))
python3 -m venv "$(XDG_CACHE_HOME)/nvim/venv" || true
Expand All @@ -35,11 +42,17 @@ endif
"$(XDG_CACHE_HOME)/nvim/venv/bin/pip" install -U pip
"$(XDG_CACHE_HOME)/nvim/venv/bin/pip" install -U pynvim

.PHONY: test
test:
$(info Testing for NVIM >= 0.10.x)
$(if $(shell nvim --version | egrep 'NVIM v0\.1[0-9]\.'),\
$(info OK),\
$(error .. You need Neovim 0.10.x or newer))
@echo All tests passed, hooray!

.PHONY: install update create-dirs update-repo update-plugins uninstall venv test
.PHONY: docker
docker:
docker run -w /root -it --rm alpine:edge sh -uelic ' \
apk add git neovim ripgrep alpine-sdk --update && \
git clone https://github.com/rafi/vim-config ~/.config/nvim && \
cd ~/.config/nvim && nvim'
2 changes: 1 addition & 1 deletion lua/rafi/config/options.lua
Original file line number Diff line number Diff line change
Expand Up @@ -212,12 +212,12 @@ vim.filetype.add({
Brewfile = 'ruby',
justfile = 'just',
Justfile = 'just',
Tmuxfile = 'tmux',
['.buckconfig'] = 'toml',
['.flowconfig'] = 'ini',
['.jsbeautifyrc'] = 'json',
['.jscsrc'] = 'json',
['.watchmanconfig'] = 'json',
['todo.txt'] = 'todotxt',
},
pattern = {
['.*%.js%.map'] = 'json',
Expand Down
5 changes: 1 addition & 4 deletions lua/rafi/plugins/neo-tree.lua
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,7 @@ return {
-- File explorer written in Lua
'nvim-neo-tree/neo-tree.nvim',
branch = 'v3.x',
dependencies = {
'MunifTanjim/nui.nvim',
's1n7ax/nvim-window-picker',
},
dependencies = { 'MunifTanjim/nui.nvim' },
cmd = 'Neotree',
-- stylua: ignore
keys = {
Expand Down
2 changes: 2 additions & 0 deletions lua/rafi/plugins/ui.lua
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ return {
-- indicator = {
-- style = 'underline',
-- },
close_command = function(n) LazyVim.ui.bufremove(n) end,
right_mouse_command = function(n) LazyVim.ui.bufremove(n) end,
diagnostics_indicator = function(_, _, diag)
local icons = require('lazyvim.config').icons.diagnostics
local ret = (diag.error and icons.Error .. diag.error .. ' ' or '')
Expand Down

0 comments on commit de94dfd

Please sign in to comment.