0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

20240408 日記 cder.nvimの変更、気になってるエントリ

Last updated at Posted at 2024-04-08

cder.nvimの変更

cder.nvimはWindowsだと動かないのでプラグイン本体に手を加える必要があった
ついでにデフォルトのoptsもWindows用にあれこれしようと思う

の前に、Neo-treeの使い勝手改善

初めて知ったんだけどNeo-treeはfile、buffer、gitの3つのモードがある、それぞれ、ファイルシステム(デフォルト)、バッファで開いてるものだけ、gitで変更のある分だけ、という感じ

詳細は Recipes · nvim-neo-tree/neo-tree.nvim Wiki
本当はトグルで同じキーを押すとfile -> buffer -> git -> file...と順番になってほしいが、現在のモードをとる方法がわからないので、Recipesにあるのをそのまま使う

init.lua
require('neo-tree').setup({
  window = {
    mappings = {
      ['e'] = function() vim.api.nvim_exec('Neotree focus filesystem left', true) end,
      ['b'] = function() vim.api.nvim_exec('Neotree focus buffers left', true) end,
      ['g'] = function() vim.api.nvim_exec('Neotree focus git_status left', true) end,
    },
  },
})

これやると便利

Windows用修正を入れた

ここに入ってます
tontoroRR/cder.nvim at support_windows

使うときは以下のようにしとくとよいです
ezabatfdexafdfind使ってるのでそこらへんは適当に

Lazy使う場合
  {
    'tontoroRR/cder.nvim',
    branch = 'support_windows',
    event = 'VeryLazy', -- lz
    config = function ()
      m = {
        {'<Leader>tc',  ':Telescope cder<CR>'}, -- km
      }
      map_keys(m, vim.keymap.set)
      local fd_param = '--type directory --type symlink --exclude .git'
      if vim.loop.os_uname().sysname == 'Windows_NT' then
        require('telescope').setup({
          extensions = {
            cder = {
              command_executer = { 'cmd.exe', '/c' },
              previewer_command = 'eza -a -F --icons --color -1', -- uutils ls -a',
              pager_commnd = 'bat --plain --paging=always --pager="less -RS"',
              dir_command = { 'fd.exe', '--type=d', '--type=l', '.', },
            }
          },
        })
      else
        require('telescope').setup({
          extensions = {
            cder = {
              dir_command = { 'fdfind', '--type=d', '--type=l', '--exclude=.git', '.', },
              previewer_command = 'exa -a --icons --color=auto -F -1',
            },
          },
        })
      end
      require('telescope').load_extension 'cder'
    end
  },

いろいろ気になるところがある

  • Windows用のデフォルトを入れたい
    • 今はinit.lua側で設定しているけど
  • フォルダアイコン、ちょっと変
  • なぜかフィルタがうまく動かない
  • 存在しないフォルダ名を入力してEnterするとエラー
  • cderで移動した場合、zoxideとの連携がうまくいかない

いずれ本家にプルリクだそう、

気になってるエントリ

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?