Giter VIP home page Giter VIP logo

ranger.vim's Introduction

ranger.vim

(https://github.com/rafaqz/ranger.vim)

Ranger for vim!

Ranger is a scriptable terminal file manager with vim like commands that displays files as you browse (even images).

https://ranger.github.io/

This plugin draws on the examples included with ranger and airodactyl/neovim-ranger to embed ranger as vims file manager, as a better alternative to the built in file manager or nerd-tree.

I maintain this version because it does a lot more than the other ranger plugins, and I need the things.

  • It's vim and neovim compatible.
  • It can open files in the current tab, new tabs, splits or vertical splits.
  • It can insert/append filenames into the current buffer.
  • It works as an operator to replace a file path selected with any vim movement.
  • It works as an operator to browse and open files from a selected file path.
  • It now completely replaces vims internal file browser with ranger by default (thanks airodactyl).
  • It can change the current working directory (:cd and :lcd).

gvim

Ranger needs to run in an external terminal in gvim, so specify your terminal with the program flag:

let g:ranger_terminal = 'urxvt -e'
let g:ranger_terminal = 'xterm -e'

In vim 8 gvim, ranger does not run smoothly in the internal terminal, and asynchronous execution means there gvim doesn't know when ranger is finished. For now, use vim or nvim only.

Suggested Mappings

The rest of the readme assumes these mappings:

map <leader>rr :RangerEdit<cr>
map <leader>rv :RangerVSplit<cr>
map <leader>rs :RangerSplit<cr>
map <leader>rt :RangerTab<cr>
map <leader>ri :RangerInsert<cr>
map <leader>ra :RangerAppend<cr>
map <leader>rc :set operatorfunc=RangerChangeOperator<cr>g@
map <leader>rd :RangerCD<cr>
map <leader>rld :RangerLCD<cr>

To browse and open file(s) with ranger:

<leader>rr

Open files(s) with ranger in tabs, splits and vertical splits. Each file selected gets a new tab/split.

<leader>rt
<leader>rs
<leader>rv

To insert or append a filepath:

<leader>ri
<leader>ra

To change string insertion format

The format of inserted strings can be set with:

let g:ranger_insert_format = ":~:."

where the value is passed to fnamemodify.

To use ranger as an operator and change a file path under the cursor:

<leader>rc[movement]

This example will replace the text inside () with whatever file path you select in ranger. If it's already a valid path ranger will open there:

<leader>rci( 

To change the current working directory:

<leader>rd
<leader>rld

ranger.vim's People

Contributors

rafaqz avatar infokiller avatar charlespwd avatar cjpbirkbeck avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.