[fish] fix title string duplication when in folders
This commit is contained in:
parent
99a4db7bef
commit
91ce304ce7
|
@ -1,5 +1,6 @@
|
|||
function fish_title --argument-names last_cmd
|
||||
set prefix ""
|
||||
set last_path (string split ' ' $last_cmd)[2..]
|
||||
|
||||
if set -q SSH_CLIENT
|
||||
if not set -q TMUX
|
||||
|
@ -12,7 +13,7 @@ function fish_title --argument-names last_cmd
|
|||
if [ fish != $_ ]
|
||||
switch $_
|
||||
case vi vim nvim
|
||||
echo "$prefix$_ $(path basename $last_cmd)"
|
||||
echo "$prefix$_ $(path basename $last_path)"
|
||||
case '*'
|
||||
echo "$prefix$last_cmd"
|
||||
end
|
||||
|
|
|
@ -63,18 +63,33 @@ return {
|
|||
-- project local commands
|
||||
null_ls.builtins.formatting.eslint.with({
|
||||
condition = function()
|
||||
return cmd_resolver.from_node_modules("eslint")
|
||||
local cmd = cmd_resolver.from_node_modules()({
|
||||
command = "eslint",
|
||||
bufnr = vim.api.nvim_get_current_buf(),
|
||||
bufname = vim.api.nvim_buf_get_name(vim.api.nvim_get_current_buf()),
|
||||
})
|
||||
return utils.is_executable(cmd)
|
||||
end,
|
||||
}),
|
||||
null_ls.builtins.diagnostics.eslint.with({
|
||||
condition = function()
|
||||
return cmd_resolver.from_node_modules("eslint")
|
||||
local cmd = cmd_resolver.from_node_modules()({
|
||||
command = "eslint",
|
||||
bufnr = vim.api.nvim_get_current_buf(),
|
||||
bufname = vim.api.nvim_buf_get_name(vim.api.nvim_get_current_buf()),
|
||||
})
|
||||
return utils.is_executable(cmd)
|
||||
end,
|
||||
}),
|
||||
|
||||
null_ls.builtins.formatting.prettier.with({
|
||||
condition = function()
|
||||
return cmd_resolver.from_node_modules("prettier")
|
||||
local cmd = cmd_resolver.from_node_modules()({
|
||||
command = "prettier",
|
||||
bufnr = vim.api.nvim_get_current_buf(),
|
||||
bufname = vim.api.nvim_buf_get_name(vim.api.nvim_get_current_buf()),
|
||||
})
|
||||
return utils.is_executable(cmd)
|
||||
end,
|
||||
|
||||
filetypes = {
|
||||
|
@ -189,6 +204,11 @@ return {
|
|||
return utils.is_executable("markdownlint")
|
||||
end,
|
||||
}),
|
||||
null_ls.builtins.formatting.markdownlint.with({
|
||||
condition = function()
|
||||
return utils.is_executable("markdownlint")
|
||||
end,
|
||||
}),
|
||||
|
||||
null_ls.builtins.diagnostics.mypy.with({
|
||||
condition = function()
|
||||
|
|
Loading…
Reference in New Issue