我有2个文件:
如何从org文件创建php文件中某行的链接?所以单击它会将光标移动到php文件中的相应行。
答案 0 :(得分:13)
在组织模式中使用此表示法来创建链接:
[[/path/to/file.php::line][string-to-display]]
如果要显示文件名,请使用
[[/path/to/file.php::line]]
有关详细信息和指定链接的其他方式,请参阅组织模式信息页面中的 Hyperlinks 。
答案 1 :(得分:1)
如果我理解正确的问题,你可以使用两个组织模式命令自动完成:
M-x org-store-link
C-c C-l
或M-x org-insert-link
并按照迷你缓冲区中的说明进行操作C-c C-o
当点在其上时打开链接我org-store-link
C-c l
和org-insert-link
C-c C-l
export class AuthInterceptor implements HttpInterceptor {
constructor(private router: Router) { }
intercept(req: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {
if (req.headers.get('No-Auth') == "True")
return next.handle(req.clone());
if (localStorage.getItem('userToken') != null) {
const clonedreq = req.clone({
headers: req.headers.set("Authorization", "Bearer " + localStorage.getItem('userToken'))
});
return next.handle(clonedreq)
.pipe(
tap(event => {
if (event instanceof HttpResponse) {
const elapsed = Date.now();
console.log(`Request for ${req.urlWithParams} took ${elapsed} ms.`);
}
}, error => {
console.error('NICE ERROR', error)
})
);
}
else {
this.router.navigateByUrl('/login');
}
}
}
。这使得该过程非常方便且快速地执行。
玩org-mode。