How to switch to HoTT-mode for Lean 2 in Emacs - lean

I compiled Lean 2 from the github repository. Then, as instructed in scr/emacs/README.md, I modified my .emacs file, opened a file, clicked on 'Create new project', clicked on 'Open', typed 'hott' and pressed Enter.
Then I typed
print eq.inverse
and I received a message
1:1: print result:
1:17: invalid print command
I also tried the command lean-hott-mode with the same results.
What am I doing wrong?

I've figured it out.
Apparently, Lean requires HoTT files to have the extension *.hlean

Related

Ctrl-p Vim bug - unclear what error message is telling me

prt path <mru>={ files }=<buf> <-> /home/....
Error detected while processing function <SNR>48_NormalPasta:
line 13:
E21: Cannot make changes, 'modifiable' is off
Press ENTER or type command to continue
kind of a strange vim error I get when I try to type the 'p' character using vim & ctrlp, using linux ubuntu here
Let's take that message one line at a time:
Error detected while processing function <SNR>48_NormalPasta:
There is an error in function NormalPasta() in the 48th script that was sourced by Vim.
line 13:
The error is on line 13 of that function.
E21: Cannot make changes, 'modifiable' is off
The function is trying to edit a non-modifiable buffer.
From there, you can do:
:filter 48 scriptnames
or:
$ grep -R NormalPasta ~/.vim/**/*.vim
to find in what script the problematic function is located.
This leads to this plugin, which appears to be OK. The whole situation seems rather strange, though, because the problematic function is supposed to be called from normal mode and I don't think a) that you should be in normal mode at CtrlP's prompt and b) that the CtrlP prompt is supposed to be non-modifiable.
My opinion is that the vim-pasta plugin is OK and thus that there is something fishy going on with CtrlP itself or the way you use it.

When echo text in .tcsh file the less command is not working properly

I have a strange problem that I didn't able to find solution for it:
When I login to my environment it configured to work with tcsh (I want to keep it like that), but when I edit the file ".tcshrc" and put the below code (Only these 2 lines), the text is printed correctly in RED, but after that the "less" command is not working anymore.
When I remove this line, less command works properly.
#!/bin/tcsh
echo "THIS LINE IS OK"
Does someone knows what could be the reason? I'm using less version: (less 436)
I create a text file: "dummy.txt" and write the following text inside: "THIS IS A DUMMY FILE"
CMD: cat dummy.txt
OUTPUT:
THIS IS A DUMMY FILE
CMD: less dummy.txt
OUTPUT:
THIS LINE IS OK
dummy.txt (END)
Only less command is not working, other commands: cat, more, vi are working properly.
Thanks in advance to the once who try to assist.
Ok, I found the issue, it is well explained in the following link:
http://www.greenwoodsoftware.com/less/faq.html#profileout
I have moved my code to ".login" instead.

Turn off terminal entry line prefix/header

How do I fix this? I don't want to change my server name I just want to customize the text here (no server name, still shows path/user). Also what's this section of the terminal window called?
The Terminal Entry line prefix is called the shell prompt.
You can generally find the current config by typing
echo $PS1
That returned this for me: [\e]0;\u#^C\w\a]${debian_chroot:+($debian_chroot)}\u#\h:\w\$
So I was able to remove the "#\h" in both locations and get the desired tag.
export PS1="\[\e]0;\u: \w\a\]${debian_chroot:+($debian_chroot)}\u:\w\$ "
leaving me with "root:/kliq$'

Vim prints meaningless error

When I load vim I get the following message that I cannot figure out how to debug.
4FNVHQ1|tmp
λ vim
default
Press ENTER or type command to continue
4FNVHQ1|tmp
λ
I've run vim -V9myVimLog and got this in the output but there's still nothing useful to me.
....
chdir(/c/Users/bjones/.vim/bundle/vundle/autoload/vundle)
fchdir() to previous dir
line 5: sourcing "/c/Users/bjones/.vim/bundle/vundle/autoload/vundle/config.vim"
finished sourcing /c/Users/bjones/.vim/bundle/vundle/autoload/vundle/config.vim
continuing in function vundle#rc
default
Searching for "filetype.vim" in "/c/Users/bjones/.vim/bundle/vim-javascript,/c/Users/bjones/.vim/bundle/vim-coffee-script,/c/Users/bjones/.vim/bundle/vim-jade,/c/Users/bjones/.vim/bundle/nerdtree,/c/Users/bjones/.vim/bundle/vim-rails,/c/Users/bjones/.vim/bundle/vim-commentary,/c/Users/bjones/.vim/bundle/vim-rake,/c/Users/bjones/.vim/bundle/snipMate,/c/Users/bjones/.vim/bundle/bsh.vim,/c/Users/bjones/.vim/bundle/vim-csharp,/c/Users/bjones/.vim/bundle/vim-distinguished,/c/Users/bjones/.vim/bundle/surround.vim,/c/Users/bjones/.vim/bundle/ctrlp.vim,/c/Users/bjones/.vim/bundle/jshint2.vim,/c/Users/bjones/.vim/bundle/vim-ps1,/c/Users/bjones/.vim/bundle/MatchTag,/c/Users/bjones/.vim/bundle/VCard-syntax,/c/Users/bjones/.vim/bundle/vim-liquid,/c/Users/bjones/.vim/bundle/vim-jst,/c/Users/bjones/.vim/bundle/vim-stylus,/c/Users/bjones/.vim/bundle/vim-swigjs,/c/Users/bjones/.vim/bundle/xmledit,/c/Users/bjones/.vim/bundle/vim-less,/c/Users/bjones/.vim/bundle/vim-markdown,/c/Users/bjones/.vim/bundle/vim-nerdtree-tabs,/c/Use
Searching for "/c/Users/bjones/.vim/bundle/vim-javascript/filetype.vim"
Searching for "/c/Users/bjones/.vim/bundle/vim-coffee-script/filetype.vim"
....
As you can see the word "default" is printed awkwardly in the debug log but there's nothing helpful.
Any help would be greatly appreciated.
EDIT: My vimrc is here: https://gist.github.com/brettof86/9906968
EDIT2 [FIX?]: IDK how it made a difference but I commented out every "Bundle" command in my vimrc then saved and quit. Then I went back and uncommented them 5 at a time and it started working? I have no idea why it was broken but I hope this helps anyone who may also run into this issue.
You mistakenly added an extra line colors in your vimrc, that as an VIM Ex command outputs the current selected colorscheme and since you haven't defined one yet, it outputs default since that is, as the name suggests, the default VIM colorscheme. You should comment it out since it clearly appears to be a documenting comment rather than executing an Ex command.

How do you compile and run haskell on notepad++

How do you compile and run Haskell on notepad++
I installed the plugin NppExec and then I pressed F6
I saved my Haskell file to C:\Users\Sam\Desktop\haskell files\new 3.hs
So on the command after I press F6 I tried typing in a few different things:
C:\Users\Sam\Desktop\haskell files\new 3.hs`
ghc.exe new 3.hs
haskell new
but I got these responses:
C:\Users\Sam\Desktop\haskell files\new 3.hs
CreateProcess() failed with error code 2:
The system cannot find the file specified.
ghc.exe new 3.hs
Process started >>>
target `new' is not a module name or a source file
<<< Process finished.
haskell new 3
CreateProcess() failed with error code 2:
The system cannot find the file specified.
================ READY ================
What is the correct way of compiling and executing at haskell file on notepad++?
You need to set NppExec to work in the current directory, so In Plugins, NppExec, tick Follow $(CURRENT_DIRECTORY).
Use the command ghc new3.hs when you press F6 (no spaces in filenames).
If you're using Haskell with stack, I found a lovely way to run things quickly using NppExec. It's a simpler process than it looks and once you do it, you're good to go:
Suppose you have a file like this in a file called yourFileName.hs:
main :: IO ()
main = putStrLn "Hello world!"
Press F6 to begin NppExec. (See Note 1 below.)
Paste the below into the window.
cd "$(FULL_CURRENT_PATH)"
stack ghci
// This is a comment you can delete. Note 2 below.
(See Note 3 below.)
Upon pressing the OK button, the Notepad++ console will run the Haskell interpreter.
Now, press F6 again. A warning menu will pop up.
Type this into the menu: :cmd return $ unlines [":l yourFileName", ":main"] and press ENTER. The file will execute. Pressing F6+ENTER will load and run the file again. When you open Notepad++ next time, this will still be there. Whenever you want to work with a new file, you will have to change yourFileName of course.
Explanation: :cmd return " . . . " allows you to execute a string as multiple ghci commands, separated by \n. unlines takes a list of strings and joins them with \n. If you don't know about $, you'll learn it soon as it's part of basic Haskell.
If you don't have a main function in your file, then instead use :cmd return $ unlines [":l yourFileName"].
Note 1: For convenience, I used the Settings > ShortCutMapper > Plugin Commands to change Execute from F6 to F1.
Note 2: If you run multiple languages in this way (like maybe Lisp?), then you can replace the // This is a comment... line with // :cmd return $ unlines [":l yourFileName", ":main"] just so you have it for later when you switch back to Haskell.
Note 3: Instead of pasting cd "$(FULL_CURRENT_PATH)" stack ghci into the NppExec window, a much simpler way to do all this is to paste stack runghc "$(FULL_CURRENT_PATH)" and nothing else needs to be done. However I found the console takes a lot longer to load and run the file in that case, so the method above is what I use.

Resources