Блог пользователя Hernan

Автор Hernan, 16 лет назад, По-английски
logo

Many people ask for the best IDE for programming contests where you don't need all the features than eclipse, Netbeans or VS has, there are many simple editors but only a few editors are really worth using.

Far Manager is a great tool for training in programming comptetitions because you can add lots of plugins avalible for it and extend the power like acced to ftp server, open compressed files, syntax highlighting, etc..

Far Manager has an simple editor than you can use for write source code and test data for a problem, you can also manage your files, preview text files and execute system commands to call compilers.



What is Far Manager?

The oficial site says:

" Far Manager is a program for managing files and archives in Windows operating systems. "

Download

You can download Far Manager here, i strongly recommend download the latest nightly build in archive mode.
After download is finished uncompress the .7z file in a folder called Far then run far.exe.

screenshoot

Far Manager Main Screen


The Basics

Read the problem statement of Theatre Square, i use the solutions of t__nt in C++ for explain the basics of Far Manager.

1: #include <cstdio>
2:
3: int n, m, a;
4:
5: int main() {
6: scanf("%d%d%d", &n, &m, &a);
7: printf("%lld\n", ((n + a - 1LL) / a) * ((m + a - 1LL) / a));
8: return 0;
9: }

The main screen contains two panels and the command line, you can rename, delete, create and view files or folders also copy or move files or folders between panels.

In the command line using the plugin farcmds you can call system commands like type echo and others.

screenshoot

Panels and Command Line

Make a folder called codeforces where you will put your source code pressing F7.

screenshoot

Making a folder


Type cd codeforces the press Shift + F4 for create a new file: theatre.cpp

screenshoot

Create a File


Now you can type the source code and save pressing F2.

screenshoot

Editor

Close the file pressing F10.
For compile the source code, assuming g++ is in the Path, type far:view <g++ -o theatre.exe theatre.cpp and you'll see the compiler messages, quit with F10 too.
Now create your input file theatre.in with the next content:

6 6 4

the solution for this test case is 4.

Run your program typing far:view <theatre <theatre.in

Syntax Highlighting

Colorer is a plugin for Far Manager than allow you highlight the source code for many languages, you can download here and uncompress into the Plugins folder.
After restart far you can view:


screenshoot

Editor with Colorer

Notes

You can use Far Manager in Linux if you have wine installed.
  • Проголосовать: нравится
  • +10
  • Проголосовать: не нравится

16 лет назад, скрыть # |
 
Проголосовать: нравится +6 Проголосовать: не нравится
First of all I need to note, that most of Russian best teams of 2008 during Petrozavodsk training camp were using Far as their primary IDE. E.g.  SpbSU Burunduchki, or Orel STU with Dmitriy Zhukov and many others. Petr, as I remember, was using other IDE, but still was using Far to organize his source files during the competitions.

There are several interesting features which are not covered in the post.

Typing each time "g++ bla.cpp" is kind of annoying (even though linux-guys like doing so)
Moreover, if you use Visual C++ compiler, which is more common case for Windows user, path to cl is not even in PATH.

There's a very nice workaround - press F9, in the menu appeared choose Commands->File Associations, press Ins, then for mask enter "*.cpp", for description something reasonable, line "C++ Source File" and for execute command something like
g++ !.!
or, if you use visual studio,
C:\"Program Files"\"Microsoft Visual Studio 10.0"\VC\vcvarsall.bat && C:\"Program Files"\"Microsoft Visual Studio 10.0"\VC\bin\cl.exe !.! && del !.obj
(don't forget to change path to visual studio)

Also, for java you can create associations for java compiler (extension: *.java, command: javac !.!) and java classes (extension: *.class, command: java !). For python (extension *.py, command: python !.!)
For C#
C:\Windows\Microsoft.NET\Framework\v4.0.30128\csc.exe /o !.!
(don't forget to change path to .NET framework)

After that you can compile source file by just pressing enter on them, which in most cases grant you higher productivity than any other IDE, as Far behaves much faster, and allows you to switch between different source files or between source file and input or between source file and output faster.
16 лет назад, скрыть # |
 
Проголосовать: нравится +1 Проголосовать: не нравится

Yeah, Far is a very powerful IDE. But to my mind it is useful only in olympiads and tiny projects. Using a debugger with Far is not a trivial task. Thus to debug a program one can use only console output and code reading. This forces you to search bugs not by tracing the program but by careful reading one line after another.

Being able to find bugs while reading the code is very useful in ACM-like contests. A computer is a bottleneck so it's better to use it for writing solutions than for searching bugs.

  • 16 лет назад, скрыть # ^ |
     
    Проголосовать: нравится 0 Проголосовать: не нравится

    Our team solved this problem.

    At the beginning we created a project in Visual Studio called "template" with one file: solution.cpp

    When we are going to solve problem X, we just copy "template" project into X directory and start to write code in solution.cpp file. If anything goes wrong, we just press Enter at the template.vcproj file and Visual Studio opens, ready to debug our code, written in Far.

  • 16 лет назад, скрыть # ^ |
     
    Проголосовать: нравится 0 Проголосовать: не нравится
    When I use far as IDE for olympiads, i used gdb as debugger.
16 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится
Thank you for this useful article. I didn't know about far:view feature even though I have been using FAR for 1 year. However, all these far:view, far:edit and other commands don't work when you set "Execute command " in "File association" menu. Do you know any workaround for this issue?
16 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится
Лучше только vim.
16 лет назад, скрыть # |
 
Проголосовать: нравится -15 Проголосовать: не нравится

What is  [b][url=http://www.replica-watch-sale.com/]Breitling[/url][/b]?  Do you know  [b][url=http://www.replica-watch-sale.com/]Breitling Watches[/url][/b]?  Buy these  [b][url=http://www.replica-watch-sale.com/]Breitling Watches sale[/url][/b]  on line.More  [b][url=http://www.replica-watch-sale.com/]cheap Breitling Watches[/url][/b]  for sale!  岩姐测试!如有雷同,纯属巧合!

What is  <a href=http://www.replica-watch-sale.com/>Breitling</a>?  Do you know  <a href=http://www.replica-watch-sale.com/>Breitling Watches</a>?  Buy these  <a href=http://www.replica-watch-sale.com/>Breitling Watches sale</a>  on line.More  <a href=http://www.replica-watch-sale.com/>cheap Breitling Watches</a>  for sale!  岩姐测试!如有雷同,纯属巧合!

16 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится
For GNU/Linux a similar tool is Midnight Commander.
16 лет назад, скрыть # |
 
Проголосовать: нравится +6 Проголосовать: не нравится
How do I see contents of STL collections in debug mode in this super IDE ?
15 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится
vim решает =)
15 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится
Can I create a template for some file extensions? For ex: if I will create "problem.cpp", there will be prepared code: "#include<...> using namespace std ....".
15 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится
Thank you very much)
15 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

А есть ли версия FAR или плагин с поддержкой Redo?

Если нет, то как без столь нужной вещи обходятся те, кто используют FAR на контестах?

15 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится
To the point, did you get Far Manager to work under Linux? When I installed it under wine, the plugins work rather well, but I couldn't run far and compilation commands. If you or someone managed to cope with this problem, please, share!
14 лет назад, скрыть # |
 
Проголосовать: нравится -28 Проголосовать: не нравится
Это полное УГ!
  • 14 лет назад, скрыть # ^ |
     
    Проголосовать: нравится 0 Проголосовать: не нравится
    Многим нравится. В этом есть некоторые плюсы, как например отказ от дебагинга, который заставляет писать код более внимательно, ибо потом у тебя не будет возможности в дебагере стопануть задачу и смотреть на содержиное стека вызовов, на содержимое переменных и прочее. Дисциплинизирует такой изврат, сам практиковал. Самое страшное что я видел до сих пор, это vim со сброшенными настройками, я там ваще нифига сделать не могу. Я юзаю vim, но файлик настроек украл у товарища.
14 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится 0 Проголосовать: не нравится

Я не очень понимаю английский, поэтому можете поподробнее объяснить как компилировать исходники на c++ с помощью g++. Точнее, что именно написать в командной строке, т.к. у меня выдает, что g++ не является командой.

  • 14 лет назад, скрыть # ^ |
     
    Проголосовать: нравится 0 Проголосовать: не нравится
    g++ должен быть установлен.
    Если после этого не удается, нужно добавить его в переменную окружения PATH или писать полный путь типа c:\...\g++.exe
    • 14 лет назад, скрыть # ^ |
       
      Проголосовать: нравится 0 Проголосовать: не нравится
      Он установлен вместе с dev-cpp, можно ли его как-то взять оттуда или же надо ставить отдельно. И еще вопрос: можете расписать подробно про добавление g++ в переменную PATH? ( Просто я никогда раньше им не пользовался, поэтому не знаю абсолютно ничего)
»
12 лет назад, скрыть # |
 
Проголосовать: нравится +13 Проголосовать: не нравится

Как уменьшить шрифт текста в far-e?

  • »
    »
    12 лет назад, скрыть # ^ |
     
    Проголосовать: нравится +8 Проголосовать: не нравится

    Это в свойствах консоли: правой кнопкой на заголовок окна и далее выбираете свойства/умолчания. Там вроде даже можно задать "всегда для этой программы"

»
12 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

In Linux I used gedit with MC

»
12 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится +3 Проголосовать: не нравится

I think I'm not really getting it. What is the advantage of this over a good shell + editor combination like GNU EMACS or vim? Scriptability is hardly a good argument because any given piece of GNU software can be scripted

»
12 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Can you compare this program with Vim/gVim. Vim is also a powerful tool too.

»
11 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

I am trying to compile in far manager, if i install g++ on terminal it will compile? what i have to do ?

»
10 лет назад, скрыть # |
 
Проголосовать: нравится +5 Проголосовать: не нравится

For anyone curious, the syntax highlighting is included "since post build 3200", so if you download one of the newer builds of far manager, far colorer(the syntax highlighter) is already included.

»
10 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится +3 Проголосовать: не нравится

I will strongly recommend Geany for Linux. It's very simple and you don't have most of the unuseful things that Eclipse and other IDEs have. I haven't tried it on Windows but I thing there is a version for it.

»
10 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

How to set up and use indentation in Far manager ??

»
9 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится 0 Проголосовать: не нравится

Well, it was not me who started necroposting. Rumors there are, FAR is now available for Linux

»
7 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится +8 Проголосовать: не нравится

Well,when I When I type a newline,the cursor will always return to the beginning of the line.How can I solve this problem?In my opinion,when I type a new line ,the cursor will align with the previous line.

I want :

for(int i=1;i<=n;i++){
  for(int j=1;j<=m;j++){

  }
}

but not :

for(int i=1;i<=n;i++){
for(int j=1;j<=n;j++){

}
}
»
7 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится 0 Проголосовать: не нравится

nice tutorial

»
6 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

I can't seem to compile my C++ program when following Hernan's instructions. I have the right g++ and gdb. Can someone help me? Thanks in advance.

»
6 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Far is great. However I cant use Auto Bracketing which was my favourite feature. Has anybody solved this issue?

»
5 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

How do I comment multiple lines in Far Editor?

Ctrl+/ isn't working

»
5 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

I think this is the one tourist uses as his Editor

»
5 лет назад, скрыть # |
Rev. 3  
Проголосовать: нравится -10 Проголосовать: не нравится

.

»
5 лет назад, скрыть # |
 
Проголосовать: нравится -17 Проголосовать: не нравится

yeputons sir, My Far Manager crashes sometimes when i save changes made to my code and then i have to restart far and the changes which i made are not saved and i cant find anything on the internet...unfortunately, i cant keep using far during contests if this continues, please help.

  • »
    »
    5 лет назад, скрыть # ^ |
     
    Проголосовать: нравится 0 Проголосовать: не нравится

    If someone is facing a similar issue, I was previously running Far from the shortcut I pinned to my taskbar but now I always run Far from CMD and it has never crashed since, so that's that and finally, many thanks to this wonderfully supportive thread.

»
4 года назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Ancient thread, but for mac users, here is a port that I just discovered today — https://github.com/elfmz/far2l. Works almost flawlessly!

»
3 года назад, скрыть # |
Rev. 3  
Проголосовать: нравится 0 Проголосовать: не нравится

»
5 месяцев назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Is there any way to set vim as INTERNAL text editor in Far? I think i crawled around the whole net, but i didn't find anything but make keybindings to make it vim-like. Is this the only way? On mr. tourist's streams i've seen that he somehow did what i want, but there is no tutorials. I will be grateful for any help.