Coder Social home page Coder Social logo

Comments (5)

chrisbra avatar chrisbra commented on May 28, 2024

that is correct however. Internally the terminal is a buffer with a name starting with ! + shell name

from vim.

Konfekt avatar Konfekt commented on May 28, 2024

Okay, reading

When using '%' or '#', and the current or alternate file name
		is not defined, an empty string is used

I suspected that the buffer does not have a current file name. Maybe clarify in the Vim doc what a file name is.

from vim.

chrisbra avatar chrisbra commented on May 28, 2024

it seems it is documented here:

A new buffer will be created, using [command] or
'shell' as the name, prefixed with a "!". If a buffer
by this name already exists a number is added in
parentheses. E.g. if "gdb" exists the second terminal
buffer will use "!gdb (1)".
I'll add a reference to it

from vim.

Konfekt avatar Konfekt commented on May 28, 2024

Maybe easier: In :help expand(), where it says

			%		current file name
			#		alternate file name
			#n		alternate file name n

does it actually mean buffer name instead of file name? Until now I assumed %:p:h to give the path of the file of a buffer, but maybe % is rather the buffer name which coincides with the file name for a buffer showing a file.

from vim.

chrisbra avatar chrisbra commented on May 28, 2024

A buffer is a view into a file typically. So a buffer name is typically also the file name. So that is correct.

from vim.

Related Issues (20)

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.