bitcyber's blog

By bitcyber, history, 5 months ago, In English

Hello guys! I hope everyone is doing good and am a novice to Codeforces.

I have used the various editor for my software development and finally decided to stick to Vim for its simplicity and speed. I want to know what are you guys using (.vimrc configuration/plugins) for vim, especially for C++ competitive environment. If somebody can also help me to run a clang compiler for C++ code in Vim editor itself than It will be very helpful.

Looking forward to receiving responses from all of you guys!

 
 
 
 
  • Vote: I like it
  • 0
  • Vote: I do not like it

»
4 months ago, # |
Rev. 3   Vote: I like it +2 Vote: I do not like it

I use tmwilliamlin168 .vimrc. Which is linked here: Vimrc I don't use any plugins but you can use as you like. For compiling, press and for executing press I also use some of my own things like brace-auto completion. My addons are here:

set autoindent set smartindent

inoremap { {} inoremap { {}O inoremap {{ { inoremap {} {} inoremap " "" inoremap ' '' inoremap ( () inoremap [ []

These are for autoindenting, smartindenting and brace completions. Feel free to use as you wish! Hoped that this helped. BTW I don't know about a clang compiler. I use mingw which is here: Mingw Compiler

  • »
    »
    3 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    how to compile and execute the cpp file?

    • »
      »
      »
      3 months ago, # ^ |
      Rev. 2   Vote: I like it +1 Vote: I do not like it

      Once you have setup the vimrc, all you have to do is press F9 and then wait until it is done. It will say something like Hit any key to close this window. Then press F10 and you can input your data.

      • »
        »
        »
        »
        3 months ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        Thnx

      • »
        »
        »
        »
        7 weeks ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        But this is annoying to compile first and then run your program. Can we change something in vimrc file so that it will do both the things at the same time i.e compile and run at same time

        • »
          »
          »
          »
          »
          7 weeks ago, # ^ |
            Vote: I like it 0 Vote: I do not like it

          Put

          autocmd filetype cpp nnoremap <F5> :w <bar> !g++ -std=c++17 -O2 -Wall % -o %:r && %:r.exe <CR>
          

          in your vimrc. Wait a few seconds, then you can put in your input.

  • »
    »
    2 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Where to put this .vimrc file? I am on windows and I already have the _vimrc file.

    • »
      »
      »
      2 months ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      Make a new _vimrc file according to your needs outside the Vim folder and replace it with already present _vimrc file. I have done the same and it works.If you try to overwrite the existing file, it doesn't work(At least mine didn't).

»
3 months ago, # |
  Vote: I like it 0 Vote: I do not like it

You can see Rachit Jain's video on youthoob for further reference.

»
2 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Vim like VSCode Got inspired during lockdown and I learnt vim during this time. Here is a link to my neovim config files and you can see the finished config is something really close to VSCode. I spent 2 days learning and making this for NeoVim. If anyone is interested check it out on the given link. https://github.com/AnmolTomer/vim

»
7 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

There is a youtuber that made a video on it :https://www.youtube.com/watch?v=I4Rz0qoWYBI