Skip to main content
Rollback to Revision 3 - Edit approval overridden by post owner or moderator
Source Link
fvgs
  • 243
  • 1
  • 9

I'm currently trying to create the following mapping in my vimrc:

nnoremap <Leader>s :split

The :split is followed by a trailing space. This makes sense so I can enter the file name without always manually preceding it with a space. This code works in fact. However, it's not very nice from a readability perspective because it's not obvious that there's a space at the end of the mapping. It would be nice if there were a way to express the second part of the mapping as a string.

I'm not very experienced with vimscript, but I tried enclosing the second part of the mapping in double-quotes, single-quotes, and backticks, none of which result in a working mapping. Like I said, the mapping currently works as desired with the trailing space. But I would prefer a more programmer-friendly way of expressing the second part of the mapping. How can this be done?

I'm currently trying to create the following mapping:

nnoremap <Leader>s :split

The :split is followed by a trailing space. This makes sense so I can enter the file name without always manually preceding it with a space. This code works in fact. However, it's not very nice from a readability perspective because it's not obvious that there's a space at the end of the mapping. It would be nice if there were a way to express the second part of the mapping as a string.

I'm not very experienced with vimscript, but I tried enclosing the second part of the mapping in double-quotes, single-quotes, and backticks, none of which result in a working mapping. Like I said, the mapping currently works as desired with the trailing space. But I would prefer a more programmer-friendly way of expressing the second part of the mapping. How can this be done?

I'm currently trying to create the following mapping in my vimrc:

nnoremap <Leader>s :split

The :split is followed by a trailing space. This makes sense so I can enter the file name without always manually preceding it with a space. This code works in fact. However, it's not very nice from a readability perspective because it's not obvious that there's a space at the end of the mapping. It would be nice if there were a way to express the second part of the mapping as a string.

I'm not very experienced with vimscript, but I tried enclosing the second part of the mapping in double-quotes, single-quotes, and backticks, none of which result in a working mapping. Like I said, the mapping currently works as desired with the trailing space. But I would prefer a more programmer-friendly way of expressing the second part of the mapping. How can this be done?

this makes it easier for people to find this question and answer; I've removed some superflous text otherwise I cannot save the edit
Source Link

I'm currently trying to create the following mapping in my vimrc:

nnoremap <Leader>s :split

The :split is followed by a trailing space. This makes sense so I can enter the file name without always manually preceding it with a space. This code works in fact. However, it's not very nice from a readability perspective because it's not obvious that there's a space at the end of the mapping. It would be nice if there were a way to express the second part of the mapping as a string.

I'm not very experienced with vimscript, but I tried enclosing the second part of the mapping in double-quotes, single-quotes, and backticks, none of which result in a working mapping. Like I said, the mapping currently works as desired with the trailing space. But I would prefer a more programmer-friendly way of expressing the second part of the mapping. How can this be done?

I'm currently trying to create the following mapping in my vimrc:

nnoremap <Leader>s :split

The :split is followed by a trailing space. This makes sense so I can enter the file name without always manually preceding it with a space. This code works in fact. However, it's not very nice from a readability perspective because it's not obvious that there's a space at the end of the mapping. It would be nice if there were a way to express the second part of the mapping as a string.

I'm not very experienced with vimscript, but I tried enclosing the second part of the mapping in double-quotes, single-quotes, and backticks, none of which result in a working mapping. Like I said, the mapping currently works as desired with the trailing space. But I would prefer a more programmer-friendly way of expressing the second part of the mapping. How can this be done?

I'm currently trying to create the following mapping:

nnoremap <Leader>s :split

The :split is followed by a trailing space. This makes sense so I can enter the file name without always manually preceding it with a space. This code works in fact. However, it's not very nice from a readability perspective because it's not obvious that there's a space at the end of the mapping. It would be nice if there were a way to express the second part of the mapping as a string.

I'm not very experienced with vimscript, but I tried enclosing the second part of the mapping in double-quotes, single-quotes, and backticks, none of which result in a working mapping. Like I said, the mapping currently works as desired with the trailing space. But I would prefer a more programmer-friendly way of expressing the second part of the mapping. How can this be done?

added 1 character in body
Source Link
muru
  • 25.1k
  • 8
  • 83
  • 144

I'm currently trying to create the following mapping in my vimrc:

nnoremap <Leader>s :split

nnoremap <Leader>s :split

The :split is followed by a trailing space. This makes sense so I can enter the file name without always manually preceding it with a space. This code works in fact. However, it's not very nice from a readability perspective because it's not obvious that there's a space at the end of the mapping. It would be nice if there were a way to express the second part of the mapping as a string.

I'm not very experienced with vimscript, but I tried enclosing the second part of the mapping in double-quotes, single-quotes, and backticks, none of which result in a working mapping. Like I said, the mapping currently works as desired with the trailing space. But I would prefer a more programmer-friendly way of expressing the second part of the mapping. How can this be done?

I'm currently trying to create the following mapping in my vimrc:

nnoremap <Leader>s :split

The :split is followed by a trailing space. This makes sense so I can enter the file name without always manually preceding it with a space. This code works in fact. However, it's not very nice from a readability perspective because it's not obvious that there's a space at the end of the mapping. It would be nice if there were a way to express the second part of the mapping as a string.

I'm not very experienced with vimscript, but I tried enclosing the second part of the mapping in double-quotes, single-quotes, and backticks, none of which result in a working mapping. Like I said, the mapping currently works as desired with the trailing space. But I would prefer a more programmer-friendly way of expressing the second part of the mapping. How can this be done?

I'm currently trying to create the following mapping in my vimrc:

nnoremap <Leader>s :split

The :split is followed by a trailing space. This makes sense so I can enter the file name without always manually preceding it with a space. This code works in fact. However, it's not very nice from a readability perspective because it's not obvious that there's a space at the end of the mapping. It would be nice if there were a way to express the second part of the mapping as a string.

I'm not very experienced with vimscript, but I tried enclosing the second part of the mapping in double-quotes, single-quotes, and backticks, none of which result in a working mapping. Like I said, the mapping currently works as desired with the trailing space. But I would prefer a more programmer-friendly way of expressing the second part of the mapping. How can this be done?

edited tags
Link
statox
  • 50.6k
  • 19
  • 153
  • 231
Loading
Source Link
fvgs
  • 243
  • 1
  • 9
Loading