Questions tagged [letter-case]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
5 votes
1 answer
355 views

Case-sensitive search with `smartcase` set

I have set smartcase in my init.vim so searching with /lowercase is case-insensitive, which is usually what I want. However, I sometimes want to do a case-sensitive search where my target is all ...
ChocolateOverflow's user avatar
1 vote
1 answer
42 views

How can I replace a word while keeping the original casing?

Basically: cat -> horse CAT -> HORSE Cat -> Horse I know this is underspecified (e.g. unclear what cAt should become). However, is there a canonical solution for this?
Henry Henrinson's user avatar
2 votes
4 answers
3k views

How to change word under cursor to upper case in command mode with shortcut?

I want to set up a shortcut to make word under the cursor upper case in the command mode. I know that you can get the word under the cursor with expand("<cword>"). But I am not sure how do I ...
jdhao's user avatar
  • 1,003
1 vote
0 answers
630 views

Tag not found unless searched for

I have a very weird situation with my tags file not working as expected. My tag file is sorted case-insensitively (starts with !_TAG_FILE_SORTED\t2\t/foldcase/), and ignorecase is set. When I put my ...
LambdaBeta's user avatar
1 vote
2 answers
167 views

Change Case of last searched pattern

I often use # key to quickly search for a keyword. I want to change the case of the last searched pattern in the easiest possible way. One way to do this is to use \U\1 in the substitution part and ...
shivams's user avatar
  • 111
3 votes
2 answers
2k views

How do you make the command mode case insensitive?

For example, I might accidentally type something like :WQ and I want it to work like :wq when a hit enter Another case is where I am typing a longer command name, for example NERDTreeTabsClose. (Note ...
Dylanthepiguy's user avatar
0 votes
1 answer
45 views

How do I substitute two same words (of different cases) to another two words whilst retaining their original cases?

I am sorry that my English was not good enough to clearly describe the task in the title. Here is a more descriptive attempt. Let us say I have the following text \gls{tla}{TLA} (As a side note, ...
Dr Krishnakumar Gopalakrishnan's user avatar
0 votes
2 answers
721 views

How to make f{char} case insensitive?

Regarding this command: f{char} To [count]'th occurrence of {char} to the right. The cursor is placed on {char} |inclusive|. {char} ...
Anon's user avatar
  • 835
4 votes
3 answers
2k views

Caps Lock in insert mode only

Sometimes, such as when transcribing FORTRAN code, I find it useful to enter uppercase letters without holding down the Shift key. However, enabling Caps Lock is a problem in command mode. Here is my ...
Nathaniel M. Beaver's user avatar
0 votes
2 answers
221 views

Prohibit unintentional ~ from F6 button

I have a mapping to remove trailing whitespace, defined like this: nnoremap <silent> <F6> :%s/\s\+$//<CR>''. It works fine, except that if I press Esc before pressing F6, instead of ...
lindhe's user avatar
  • 467
3 votes
1 answer
995 views

Disable case sensitive auto-completion, while "smartcase" search is enabled?

I like the behavior of smartcase while searching, and I like Vim's auto-completion options, but I don't like them together. Is there any way to keep smartcase enabled, but have auto-completion results ...
Luke Davis's user avatar
  • 1,327
3 votes
2 answers
243 views

Is there a way to use ignore case only for autocompletion in insert mode?

I know I can :set ignorecase smartcase to get autompletion to be case-insensitive but this has the side-effect of making all searches case-insensitive unless they contain an uppercase character. I ...
Walf's user avatar
  • 274
3 votes
2 answers
1k views

Case Insensitive Search with g ex command?

How can you do a case insensitive search with line contexts displayed in vim while using the :g ex command? I tried the following but it doesn't seem to work... g/pattern/z#.1i|echo "================...
leeand00's user avatar
  • 3,335
-3 votes
1 answer
171 views

Make gvim show Q letter (character) [closed]

My vim doesn't represent the uppercase letter q Q? How to fix this? Here is my vimrc : set nocompatible " be iMproved, required filetype off " required syntax on set ...
Whats Myname's user avatar
2 votes
2 answers
391 views

make external command completion case insensitive when called from within Vim

I've been learning Vi/Vim for some month and, at the moment, I'm editing many files at once splitting the window, jumping from one buffer to the others. I find it very useful. One thing I don't like ...
Enlico's user avatar
  • 2,054
6 votes
1 answer
140 views

Convert word to another substituting case (upper or lower) with same case

I am looking for a way to convert one word to another while "capturing" the case of the match that is substituted. An example: I have the text: Begin the beginning Now I want to convert this to ...
user2609980's user avatar
1 vote
1 answer
194 views

How can you change the case of a backreference in Ex-mode substitute command?

For instance, let's say I want to change all instances of Ctrl-m, Ctrl-p, etc., in a document to the more conventional ^M, ^P, etc. I can use :s/Ctrl-\(.\)/^\1to almost accomplish this, but it leaves ...
Wildcard's user avatar
  • 4,305
16 votes
4 answers
4k views

How can I convert words to camelCase in a macro?

I have a list of words, like this: these are some words that I want to convert to camel case I need a way to turn, for example, camel case into camelCase within a macro (or a way to turn every line ...
Doorknob's user avatar
  • 14.6k
26 votes
1 answer
4k views

How to make movements respect camelCase or snake_case?

It is common to use either camelCase or snake_case to separate multiple words which form an identifier. It would be nice if the "word" movements (b, w, e) would detect those inner-identifier ...
Jasper's user avatar
  • 505